fix: 스키마와 코드의 제약 조건 불일치건 수정. #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| HARBOR_REGISTRY: harbor.homelab.robinjoon.xyz | |
| IMAGE_NAME: loop/server | |
| jobs: | |
| test: | |
| runs-on: [self-hosted, macOS, ARM64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| run: echo "JAVA_HOME=$(/usr/libexec/java_home -v 25)" >> $GITHUB_ENV | |
| - name: Run tests | |
| run: ./gradlew test | |
| build-and-push: | |
| runs-on: [self-hosted, macOS, ARM64] | |
| needs: test | |
| outputs: | |
| image-tag: ${{ steps.meta.outputs.tag }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| run: echo "JAVA_HOME=$(/usr/libexec/java_home -v 25)" >> $GITHUB_ENV | |
| - name: Build JAR | |
| run: ./gradlew bootJar | |
| - name: Generate image tag | |
| id: meta | |
| run: | | |
| TAG=$(date +'%Y%m%d')-${{ github.run_number }} | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Harbor | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.HARBOR_REGISTRY }} | |
| username: ${{ secrets.HARBOR_USERNAME }} | |
| password: ${{ secrets.HARBOR_PASSWORD }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.HARBOR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tag }} | |
| ${{ env.HARBOR_REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| update-helm: | |
| runs-on: [self-hosted, macOS, ARM64] | |
| needs: build-and-push | |
| steps: | |
| - name: Checkout Helm repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Spotit-KR/loop-helm | |
| token: ${{ secrets.HELM_REPO_PAT }} | |
| path: helm-repo | |
| - name: Update image tag in values-prod.yaml | |
| run: | | |
| cd helm-repo | |
| sed -i '' 's/tag: ".*"/tag: "${{ needs.build-and-push.outputs.image-tag }}"/' server/values/values-prod.yaml | |
| - name: Commit and push changes | |
| run: | | |
| cd helm-repo | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add server/values/values-prod.yaml | |
| git commit -m "chore: update server prod image tag to ${{ needs.build-and-push.outputs.image-tag }}" | |
| git push |