diff --git a/.github/workflows/reusable_dockerfile_pipeline.yml b/.github/workflows/reusable_dockerfile_pipeline.yml index ac298e3..66a3602 100644 --- a/.github/workflows/reusable_dockerfile_pipeline.yml +++ b/.github/workflows/reusable_dockerfile_pipeline.yml @@ -140,7 +140,15 @@ jobs: # only push if the branch/PR is not generated from a fork. Even though # forks can't push, we still want to try and build the image to catch # bugs. For testing purposes we only need an amd64 image. - - name: Build and Push Docker Image amd64 + - name: Build and Push Experimental Docker Image amd64 + # This will run only when the event is a push to a branch that is not 'main' + # and the ref is not a release candidate or release tag. + if: >- + github.event_name == 'push' && + github.ref != 'refs/heads/main' && + !startsWith(github.ref, 'refs/tags/v') && + !contains(github.ref, '-rc') && + github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name uses: docker/build-push-action@v5 env: OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }} @@ -150,9 +158,7 @@ jobs: provenance: false platforms: linux/amd64 # Only push if the head and base repos match, meaning it is not a fork - # yamllint disable - push: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - # yamllint enable + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} file: ${{ inputs.dockerfile }}