From 2bae1a5b09d5ebcb73d6047678057e170e704beb Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Wed, 2 Oct 2024 14:14:19 +0200 Subject: [PATCH] add clean job to remove untagged images from the GitHub package registry --- .github/workflows/docker-image.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d20cb87..6793b53 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,7 +4,6 @@ on: push: jobs: - build: runs-on: ubuntu-latest steps: @@ -38,3 +37,19 @@ jobs: - name: deploy run: | curl -X POST https://keel1.edirom.de/v1/webhooks/native -H 'Content-Type: application/json' -d '{"name": "ghcr.io/edirom/cartographer-app", "tag": "dev"}' + + clean: + name: remove untagged images from Github package registry + runs-on: ubuntu-latest + needs: build + permissions: + packages: write + steps: + - name: ghcr.io cleanup action + uses: dataaxiom/ghcr-cleanup-action@v1 + with: + delete-untagged: true + dry-run: false + validate: true + older-than: 2 weeks + token: ${{ secrets.GITHUB_TOKEN }}