From 48071b9fd1794ee13221654ea6a1e46f66c56fb2 Mon Sep 17 00:00:00 2001 From: Athou Date: Sat, 15 Feb 2025 10:13:25 +0100 Subject: [PATCH] PRs now build the docker images but don't push them --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0045b9ad..130dbcb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,8 @@ jobs: docker: runs-on: ubuntu-latest needs: build - if: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }} + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} strategy: matrix: @@ -110,6 +111,7 @@ jobs: # Docker - name: Login to Container Registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 + if: ${{ env.DOCKERHUB_USERNAME != '' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -121,7 +123,7 @@ jobs: with: context: . file: commafeed-server/src/main/docker/Dockerfile.native - push: true + push: ${{ env.DOCKERHUB_USERNAME != '' }} platforms: linux/amd64,linux/arm64/v8 tags: | athou/commafeed:latest-${{ matrix.database }} @@ -133,7 +135,7 @@ jobs: with: context: . file: commafeed-server/src/main/docker/Dockerfile.jvm - push: true + push: ${{ env.DOCKERHUB_USERNAME != '' }} platforms: linux/amd64,linux/arm64/v8 tags: | athou/commafeed:latest-${{ matrix.database }}-jvm @@ -146,7 +148,7 @@ jobs: with: context: . file: commafeed-server/src/main/docker/Dockerfile.native - push: true + push: ${{ env.DOCKERHUB_USERNAME != '' }} platforms: linux/amd64,linux/arm64/v8 tags: athou/commafeed:master-${{ matrix.database }} @@ -156,7 +158,7 @@ jobs: with: context: . file: commafeed-server/src/main/docker/Dockerfile.jvm - push: true + push: ${{ env.DOCKERHUB_USERNAME != '' }} platforms: linux/amd64,linux/arm64/v8 tags: athou/commafeed:master-${{ matrix.database }}-jvm