diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 629dc245..072c86fa 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -69,11 +69,13 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 + if: github.secret_source == 'Actions' with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry uses: docker/login-action@v2 + if: github.secret_source == 'Actions' with: registry: ghcr.io username: ${{ github.actor }} @@ -100,7 +102,7 @@ jobs: context: . file: ${{ matrix.dockerfile }} pull: true - push: true + push: ${{ github.secret_source == 'Actions' }} platforms: ${{ matrix.platforms }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}