refactor: 펫 카탈로그 어드민 API 제거 #144
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: Docker Build & Push & GitOps Update | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| # Git 체크아웃 | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'corretto' | |
| java-version: '17' | |
| # Docker 로그인 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| # 커밋 해시 추출 | |
| - name: Extract Git Info | |
| id: git_info | |
| run: | | |
| echo "full_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
| # Jib 빌드 및 푸시 | |
| - name: Jib Build & Push | |
| env: | |
| GITHUB_SHA: ${{ env.full_commit }} | |
| DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew jib | |
| # GitOps 레포 클론 | |
| - name: Checkout GitOps repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: ddan-dda-ra/gitops | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| path: gitops | |
| # 이미지 태그 업데이트 및 커밋 | |
| - name: Update GitOps image tag and commit | |
| run: | | |
| cd gitops/ddan-ddan-app | |
| sed -i "s/tag: .*/tag: \"${full_commit}\"/" values-dev.yaml | |
| sed -i "s/tag: .*/tag: \"${full_commit}\"/" values-prod.yaml | |
| git config user.name "github-actions" | |
| git config user.email "actions@github.com" | |
| git add values-dev.yaml | |
| git add values-prod.yaml | |
| git commit -m "Update image tag to ${full_commit} [ci skip]" | |
| git push origin main |