From fdc89938c2e080b098da202d05c7b8e01fa1c2b0 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Sun, 15 Dec 2024 16:24:58 -0500 Subject: [PATCH] feat(ci): clean up images older than 90 days (#278) --- .github/workflows/cleanup.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/cleanup.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 00000000..bca605a9 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,24 @@ +name: Cleanup Old Images +on: + schedule: + - cron: "30 0 * * 0" # 0030 UTC on Sundays + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + +jobs: + delete-older-than-90: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Delete Images Older Than 90 Days + uses: dataaxiom/ghcr-cleanup-action@v1.0.13 + with: + token: ${{ secrets.GITHUB_TOKEN }} + packages: akmods,akmods-zfs,akmods-extra,akmods-nvidia-open + older-than: 90 days + delete-orphaned-images: true + keep-n-tagged: 7 + keep-n-untagged: 7