From d154bfc95e85c6de2ee4c9a45f836c0cba560419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 9 Dec 2022 13:38:31 +0100 Subject: [PATCH] chore: do not access Docker Hub on PRs --- .github/workflows/build-docker-image.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 825ee99..208ec7d 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -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: @@ -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 }} @@ -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