Skip to content

Commit

Permalink
#19: guard steps to only login to docker when pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Jun 6, 2024
1 parent 1030eed commit 4f321f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
if: ${{ github.ref == 'refs/heads/ci-images' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -44,5 +45,5 @@ jobs:
file: ${{ matrix.image }}.dockerfile
cache-from: type=registry,ref=docker.io/${{ env.CACHE_TAG }}
cache-to: type=registry,ref=docker.io/${{ env.CACHE_TAG }},mode=max
push: ${{ (github.event_name == 'push' || github.ref == 'refs/heads/ci-images') && 'true' || 'false' }}
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/ci-images') && 'true' || 'false' }}
tags: ${{ env.IMAGE_TAG }}

0 comments on commit 4f321f7

Please sign in to comment.