From 2bd1062d9615ad19d858bc6794faf4ac94495013 Mon Sep 17 00:00:00 2001 From: Yves Lavoie Date: Sun, 29 Oct 2023 23:46:00 -0400 Subject: [PATCH] Push onto registry if pull request is merged into master --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 307c6e3..a9f594b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -26,7 +26,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - push: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} + push: ${{ github.event_name == 'pull_request' && contains(github.ref, '/merge') && github.ref == 'refs/pull/merge' && startsWith(github.head_ref, 'refs/heads/master') }} tags: ghcr.io/${{github.repository_owner}}/ledgersmb_circleci-perl:${{ matrix.version }} build-args: | perl=${{ matrix.version }} @@ -52,7 +52,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - push: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} + push: ${{ github.event_name == 'pull_request' && contains(github.ref, '/merge') && github.ref == 'refs/pull/merge' && startsWith(github.head_ref, 'refs/heads/master') }} tags: ghcr.io/${{github.repository_owner}}/ledgersmb_circleci-postgres:${{ matrix.version }} build-args: | version=${{ matrix.version }}