From c45eade8386b342601051b4f6743bc87b0745eb3 Mon Sep 17 00:00:00 2001 From: Waldemar Kornewald Date: Mon, 13 Nov 2023 09:34:33 +0100 Subject: [PATCH] Only purge when something new gets pushed --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 32c109e..d2aceeb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -62,7 +62,7 @@ jobs: fi - name: Build and push uses: docker/build-push-action@v5 - if: github.event_name == 'workflow_dispatch' || github.event_name != 'pull_request' && steps.checkchanged.outputs.CHANGED != 'false' + if: github.event_name == 'workflow_dispatch' || (github.event_name != 'pull_request' && steps.checkchanged.outputs.CHANGED != 'false') with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 @@ -72,6 +72,7 @@ jobs: ghcr.io/${{ github.repository }}:1 - name: Purge old images uses: actions/delete-package-versions@v4 + if: github.event_name == 'workflow_dispatch' || (github.event_name != 'pull_request' && steps.checkchanged.outputs.CHANGED != 'false') with: package-name: ${{ github.event.repository.name }} package-type: 'container'