Skip to content

Commit 7a59b03

Browse files
committed
Fix: specify push: true in Docker Action
1 parent 2b772c4 commit 7a59b03

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

.github/workflows/push_image_ecr.yml

+3-13
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,21 @@ jobs:
5858
id: login-ecr
5959
uses: aws-actions/amazon-ecr-login@v1
6060

61-
- name: Build Image
62-
id: build_image
61+
- name: Build Image and Push to AWS ECR
62+
id: build_image_and_push
6363
uses: docker/build-push-action@v5
6464
env:
6565
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
6666
IMAGE_TAG: ${{ steps.tag.outputs.tag }}
6767
ECR_REPOSITORY: taxi-back
6868
with:
69+
push: true
6970
tags: |
7071
"${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}"
7172
"${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest"
7273
cache-from: type=local,src=/tmp/.buildx-cache
7374
cache-to: type=local,dest=/tmp/.buildx-cache-new
7475

75-
- name: Push to AWS ECR
76-
id: push_image
77-
env:
78-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
79-
IMAGE_TAG: ${{ steps.tag.outputs.tag }}
80-
ECR_REPOSITORY: taxi-back
81-
run: |
82-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
83-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
84-
echo "Push image : $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG and latest"
85-
8676
- name: Remove old cache
8777
run: |
8878
rm -rf /tmp/.buildx-cache

.github/workflows/push_image_ecr_dev.yml

+3-11
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,17 @@ jobs:
4343
id: login-ecr
4444
uses: aws-actions/amazon-ecr-login@v1
4545

46-
- name: Build Image
47-
id: build_image
46+
- name: Build Image and Push to AWS ECR
47+
id: build_image_and_push
4848
uses: docker/build-push-action@v5
4949
env:
5050
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
5151
ECR_REPOSITORY: taxi-back
5252
with:
53+
push: true
5354
tags: "${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:dev"
5455
cache-from: type=local,src=/tmp/.buildx-cache
5556
cache-to: type=local,dest=/tmp/.buildx-cache-new
56-
57-
- name: Push to AWS ECR
58-
id: push_image
59-
env:
60-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
61-
ECR_REPOSITORY: taxi-back
62-
run: |
63-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
64-
echo "Push image : $ECR_REGISTRY/$ECR_REPOSITORY:dev"
6557

6658
- name: Remove old cache
6759
run: |

0 commit comments

Comments
 (0)