From 02d8c30a0dd6ca83523d76c933a1fa211b0b3f00 Mon Sep 17 00:00:00 2001 From: ver4a Date: Wed, 6 Nov 2024 12:47:25 +0100 Subject: [PATCH] Rework cleanup Makes cleanup run after all other steps regardless of success or failure. Additionally removes resulting artifact. --- .forgejo/workflows/build-image.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build-image.yaml b/.forgejo/workflows/build-image.yaml index e7acf5d..dbdb156 100644 --- a/.forgejo/workflows/build-image.yaml +++ b/.forgejo/workflows/build-image.yaml @@ -8,4 +8,5 @@ jobs: - run: podman login -u ${{ vars.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ vars.REGISTRY_DOMAIN }} - run: podman build . --no-cache --pull=newer --squash-all -t ${{ vars.REGISTRY_DOMAIN }}/${{ vars.MAIN_IMAGE }}:40 - run: podman push ${{ vars.REGISTRY_DOMAIN }}/${{ vars.MAIN_IMAGE }}:40 ${{ vars.REGISTRY_DOMAIN }}/${{ vars.MAIN_IMAGE }}:40 - - run: podman image prune -f + - if: '!cancelled()' + run: podman image rm -f ${{ vars.REGISTRY_DOMAIN }}/${{ vars.MAIN_IMAGE }}:40 && podman image prune -f