Skip to content

Commit

Permalink
update condition to docker push latest on main (#397)
Browse files Browse the repository at this point in the history
* update condition to push latest on main

* add visual confirmation of route taken on push
  • Loading branch information
andrewpearce-digital committed May 16, 2024
1 parent 0a67c00 commit c189728
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ jobs:
ECR_REPOSITORY: s3-antivirus
run: |
docker tag 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus:latest 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus:${{inputs.tag}}
if [ $BRANCH_NAME == "main" ]; then
if ${{ github.ref == 'refs/heads/main' }} ; then
printf "Pushing main branch to ECR\n"
docker tag 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus:latest 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus:main-${{inputs.tag}}
# We want all of the tags pushed
docker push --all-tags $ECR_REGISTRY/$ECR_REPOSITORY
Expand All @@ -84,7 +85,8 @@ jobs:
ECR_REPOSITORY: s3-antivirus-update
run: |
docker tag 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus-update:latest 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus-update:${{inputs.tag}}
if [ $BRANCH_NAME == "main" ]; then
if ${{ github.ref == 'refs/heads/main' }}; then
printf "Pushing main branch to ECR\n"
# We want all of the tags pushed
docker tag 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus-update:latest 311462405659.dkr.ecr.eu-west-1.amazonaws.com/s3-antivirus-update:main-${{inputs.tag}}
docker push --all-tags $ECR_REGISTRY/$ECR_REPOSITORY
Expand Down

0 comments on commit c189728

Please sign in to comment.