From d4d74a96f386ac2d7ba29ead817b4cdd9cd9740b Mon Sep 17 00:00:00 2001 From: Shlee Date: Wed, 26 Aug 2026 15:31:28 +0930 Subject: [PATCH 1/2] Create docker-ghcr-cleanup.yml --- .github/workflows/docker-ghcr-cleanup.yml | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/docker-ghcr-cleanup.yml diff --git a/.github/workflows/docker-ghcr-cleanup.yml b/.github/workflows/docker-ghcr-cleanup.yml new file mode 100644 index 000000000..e07e01f7c --- /dev/null +++ b/.github/workflows/docker-ghcr-cleanup.yml @@ -0,0 +1,29 @@ +name: Cleanup Old Container Images + +on: + schedule: + - cron: '30 3 * * 0' # weekly, Sunday 03:30 UTC + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + cleanup: + runs-on: ubuntu-latest + # Only run in the upstream repo — forks shouldn't run scheduled jobs + # against their own packages using this hardcoded config, and cron + # triggers fire on forks too unless guarded like this. + if: github.repository == 'pixelfed/pixelfed' + steps: + - name: Clean up old images + uses: dataaxiom/ghcr-cleanup-action@v1 + with: + owner: pixelfed + package: pixelfed + + exclude-tags: 'latest,staging,unstable,stable,v*.*.*' + older-than: 6 months + delete-untagged: true + keep-n-tagged: 25 From 7bf4e64d957b5cda455fd9a8a564974535f4e449 Mon Sep 17 00:00:00 2001 From: Shlee Date: Wed, 26 Aug 2026 15:32:21 +0930 Subject: [PATCH 2/2] Rename workflow for GHCR container image cleanup --- .github/workflows/docker-ghcr-cleanup.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-ghcr-cleanup.yml b/.github/workflows/docker-ghcr-cleanup.yml index e07e01f7c..2956c9c46 100644 --- a/.github/workflows/docker-ghcr-cleanup.yml +++ b/.github/workflows/docker-ghcr-cleanup.yml @@ -1,4 +1,4 @@ -name: Cleanup Old Container Images +name: Cleanup Old GHCR Container Images on: schedule: @@ -12,9 +12,6 @@ permissions: jobs: cleanup: runs-on: ubuntu-latest - # Only run in the upstream repo — forks shouldn't run scheduled jobs - # against their own packages using this hardcoded config, and cron - # triggers fire on forks too unless guarded like this. if: github.repository == 'pixelfed/pixelfed' steps: - name: Clean up old images