Skip to content

Commit

Permalink
chore: do not access Docker Hub on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Dec 9, 2022
1 parent b1b4dfe commit d154bfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
RYUK_VERSION: ${{ github.event.release.tag_name || github.sha }}
IS_RELEASE: ${{ (github.event_name == 'release' && github.event.action == 'published' && 'yes') || 'no' }}

jobs:
build:
Expand Down Expand Up @@ -36,6 +37,7 @@ jobs:
run: go test -v ./...

- name: Login to Docker Hub
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -59,9 +61,10 @@ jobs:
# and https://github.com/testcontainers/moby-ryuk/pull/40
- name: Cross Build for Linux and Windows
run: |
./build-multiarch.sh testcontainers/ryuk:${RYUK_VERSION} 'yes'
./build-multiarch.sh testcontainers/ryuk:${RYUK_VERSION} ${IS_RELEASE}
run-images:
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
needs: build
strategy:
fail-fast: false
Expand Down

0 comments on commit d154bfc

Please sign in to comment.