From b6aeb846517f801f2b8c953b6f3bfced8f93deea Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Wed, 23 Oct 2024 13:45:18 -0500 Subject: [PATCH] chore(ci): ensure packages are cleaned up --- .github/workflows/cleanup-old-images.yml | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/cleanup-old-images.yml diff --git a/.github/workflows/cleanup-old-images.yml b/.github/workflows/cleanup-old-images.yml new file mode 100644 index 0000000..4a4f252 --- /dev/null +++ b/.github/workflows/cleanup-old-images.yml @@ -0,0 +1,25 @@ +name: Cleanup Old Images +on: + schedule: + - cron: '05 7 * * *' # 7:05 UTC everyday + 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 }} + older-than: 90 days + delete-orphaned-images: true + #packages: bos + #keep-n-tagged: 7 + #keep-n-untagged: 7 + #dry-run: true