Skip to content

Commit 7f22028

Browse files
authored
Add 'latest' tag to Docker image during build
Updated Docker build and push steps to tag image as 'latest' in addition to the SHA.
1 parent 8b02654 commit 7f22028

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
- name: Build and push image
2929
id: build
3030
run: |
31-
IMAGE_TAG=${{ github.sha }}
32-
docker build -t ${{ vars.ECR_URL }}:$IMAGE_TAG .
33-
docker push ${{ vars.ECR_URL }}:$IMAGE_TAG
34-
echo "image=${{ vars.ECR_URL }}:$IMAGE_TAG" >> $GITHUB_OUTPUT
31+
IMAGE_TAG=${{ github.sha }}
32+
docker build -t ${{ vars.ECR_URL }}:$IMAGE_TAG -t ${{ vars.ECR_URL }}:latest .
33+
docker push ${{ vars.ECR_URL }}:$IMAGE_TAG
34+
docker push ${{ vars.ECR_URL }}:latest
35+
echo "image=${{ vars.ECR_URL }}:$IMAGE_TAG" >> $GITHUB_OUTPUT
3536
3637
- name: Get current task definition
3738
run: |

0 commit comments

Comments
 (0)