Skip to content

Commit

Permalink
ci(ct): fix not pushing feature branches to Docker Hub IQSS#9769
Browse files Browse the repository at this point in the history
By ensuring pushes to Docker Hub are only executed for any
non-PR events when based on develop or master branch, we avoid
breaking the images on the Hub.
  • Loading branch information
poikilotherm committed Aug 10, 2023
1 parent 8993d9a commit 3149ee3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/container_app_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ jobs:
distribution: temurin

# Depending on context, we push to different targets. Login accordingly.
- if: ${{ github.event_name != 'pull_request' }}
- if: github.event_name != 'pull_request' && contains(fromJSON('["develop", "master"]'), github.ref_name)
name: Log in to Docker Hub registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Note: The team's decision was to not auto-push an image on any git push where no PR exists (yet).
# Also avoids double pushes from push and PR event.
- if: ${{ github.event_name == 'pull_request' }}
name: Login to Github Container Registry
uses: docker/login-action@v2
Expand Down

0 comments on commit 3149ee3

Please sign in to comment.