Skip to content

Commit

Permalink
Workflow docker-build: Don't try to authenticate for PR
Browse files Browse the repository at this point in the history
 * Secrets are not available anyway for forks.
  • Loading branch information
Lasall committed Jan 13, 2025
1 parent 7609e7f commit 184ca49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,25 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v3
# skip for pull requests
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to GHCR
uses: docker/login-action@v3
# skip for pull requests
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# skip for pull requests
if: ${{ github.event_name != 'pull_request' }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -114,7 +120,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
outputs: type=image,"name=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,"push=${{ github.event_name != 'pull_request' }}","annotation-index.org.opencontainers.image.description=${{ env.EOS_REPO_DESCRIPTION }}"
#push: ${{ github.event_name != 'pull_request' }}

- name: Generate artifact attestation DockerHub
uses: actions/attest-build-provenance@v2
Expand Down

0 comments on commit 184ca49

Please sign in to comment.