From 216f552358e600d7bde6e6568c23a764c82081ac Mon Sep 17 00:00:00 2001 From: Traktuner <78533119+traktuner@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:29:16 +0100 Subject: [PATCH] add separate check-pr step for build --- .github/workflows/docker-publish.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a288625..c8f8e94 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -28,6 +28,10 @@ jobs: packages: write id-token: write steps: + - name: Check if pull request + id: check-pr + run: echo "IS_PULL_REQUEST=$(test ${{ github.event_name }} == 'pull_request' && echo true || echo false)" >> $GITHUB_ENV + - name: Checkout repository uses: actions/checkout@v2 @@ -64,7 +68,7 @@ jobs: with: context: . file: ./Dockerfile.ubuntu20 - push: ${{ github.event_name != 'pull_request' }} + push: ${{ env.IS_PULL_REQUEST != 'true' }} platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -76,6 +80,10 @@ jobs: packages: write id-token: write steps: + - name: Check if pull request + id: check-pr + run: echo "IS_PULL_REQUEST=$(test ${{ github.event_name }} == 'pull_request' && echo true || echo false)" >> $GITHUB_ENV + - name: Checkout repository uses: actions/checkout@v2 @@ -112,7 +120,7 @@ jobs: with: context: . file: ./Dockerfile.ubuntu22 - push: ${{ github.event_name != 'pull_request' }} + push: ${{ env.IS_PULL_REQUEST != 'true' }} platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }}:ubuntu22 labels: ${{ steps.meta.outputs.labels }} @@ -124,6 +132,10 @@ jobs: packages: write id-token: write steps: + - name: Check if pull request + id: check-pr + run: echo "IS_PULL_REQUEST=$(test ${{ github.event_name }} == 'pull_request' && echo true || echo false)" >> $GITHUB_ENV + - name: Checkout repository uses: actions/checkout@v2 @@ -160,7 +172,7 @@ jobs: with: context: . file: ./Dockerfile.ubuntu18 - push: ${{ github.event_name != 'pull_request' }} + push: ${{ env.IS_PULL_REQUEST != 'true' }} platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:ubuntu18 labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file