diff --git a/.github/workflows/docker-minimal.yml b/.github/workflows/docker-minimal.yml index 108788e8..366894dd 100644 --- a/.github/workflows/docker-minimal.yml +++ b/.github/workflows/docker-minimal.yml @@ -3,7 +3,6 @@ name: 'Build minimal docker image' on: push: - pull_request: jobs: docker_test: @@ -30,18 +29,18 @@ jobs: uses: docker/setup-buildx-action@v3 with: platforms: ${{ env.PLATFORMS }} - - name: Login to Docker - if: github.event_name != 'pull_request' && github.event_name != 'push' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - name: Check for release tag id: release_check run: | if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "release=YES" >> $GITHUB_OUTPUT fi + - name: Login to Docker + if: steps.release_check.outputs.release == 'YES' || env.BRANCH_NAME == 'master' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push to docker hub for releases with tag id: release_build if: ${{ steps.release_check.outputs.release == 'YES' }}