From 8b82d930cc42925f38c55df726acd2e5d3a5c061 Mon Sep 17 00:00:00 2001 From: Leeseojune Date: Sun, 5 Jun 2022 19:15:25 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20::=20prod=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/prod-build.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/prod-build.yaml b/.github/workflows/prod-build.yaml index be45be79..93d8dd32 100644 --- a/.github/workflows/prod-build.yaml +++ b/.github/workflows/prod-build.yaml @@ -27,6 +27,10 @@ jobs: with: java-version: ${{ matrix.java-version }} distribution: 'zulu' + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) - name: Gradle Build uses: gradle/gradle-build-action@v2 @@ -34,6 +38,7 @@ jobs: arguments: | build --no-daemon + - name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: @@ -47,7 +52,7 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{secrets.DOCKER_USER}}/${{env.SERVICE_NAME}}-${{env.SERVICE_TYPE}}:${{ github.sha }} + tags: ${{secrets.DOCKER_USER}}/${{env.SERVICE_NAME}}-${{env.SERVICE_TYPE}}:${{ steps.get_version.outputs.VERSION }} build-args : | DB_URL=${{secrets.DB_URL_STAGE}} DB_USERNAME=${{secrets.DB_USERNAME_STAGE}} @@ -58,13 +63,16 @@ jobs: AWS_ACCESS_KEY=${{secrets.AWS_ACCESS_KEY}} AWS_SECRET_KEY=${secrets.AWS_SECRET_KEY}} + - name: Repository Dispatch uses: peter-evans/repository-dispatch@v1 with: token: ${{ secrets.GITOPS_DEPLOY_STAGE_TOKEN }} repository: team-xquare/xquare-gitops-repo-staging event-type: update_image - client-payload: '{"ref": "${{ github.ref }}", - "version": "${{ github.sha }}", + client-payload: '{ + "ref": "${{ github.ref }}", + "version": "${{ steps.get_version.outputs.VERSION }}", "service_name": "${{env.SERVICE_NAME}}", - "service_type": "${{env.SERVICE_TYPE}}"}' + "service_type": "${{env.SERVICE_TYPE}}" + }'