From 66ce7e0f4c6b6adbe6151a81b3b71ff389c592b5 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:04:12 +0900 Subject: [PATCH] fix: build_images workflow --- .github/workflows/build_images.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index ed3f622de8..e482f3d49d 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -1,4 +1,4 @@ -name: Deploy to Elastic Beanstalk +name: build new version image on: push: @@ -26,11 +26,11 @@ jobs: uses: aws-actions/amazon-ecr-login@v1 - name: Build, tag, and push image to Amazon ECR - if: endsWith(github.ref, 'heads/master') || endsWith(github.ref, 'heads/develop') env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }} - IMAGE_TAG: ${{ needs.create-app-env.outputs.image-tag }} + IMAGE_TAG: ${{ github.head_ref }}-${GITHUB_SHA::8} run: | + echo "$IMAGE_TAG" docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG