summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-11-17 14:24:26 +0800
committertranch <tranch.xiao@gmail.com>2026-11-17 14:24:26 +0800
commit95702ac4933104a7e3b6c512982fdf9334409379 (patch)
treee567cd49c63b17c7809b19117d69889ca4f3c4eb /.github/workflows
parent1be3ca5d8e552da167bb6b36e80947fe34944b20 (diff)
downloadAeroCore-OS-95702ac4933104a7e3b6c512982fdf9334409379.tar.gz
AeroCore-OS-95702ac4933104a7e3b6c512982fdf9334409379.zip
ci: add scheduled GHCR image cleanuptesting-45.20261117
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/clean.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml
new file mode 100644
index 0000000..7954c84
--- /dev/null
+++ b/.github/workflows/clean.yml
@@ -0,0 +1,40 @@
+name: Cleanup Old Images
+
+on:
+ schedule:
+ - cron: "15 0 * * 0" # 00:15 UTC every Sunday
+ workflow_dispatch:
+ inputs:
+ dry_run:
+ description: "Preview deletions without removing images"
+ required: true
+ default: true
+ type: boolean
+
+permissions: {}
+
+concurrency:
+ group: cleanup-ghcr-images
+ cancel-in-progress: false
+
+jobs:
+ cleanup-ghcr:
+ name: Clean old GHCR image versions
+ runs-on: ubuntu-latest
+ permissions:
+ packages: write
+
+ steps:
+ - name: Delete images older than 90 days
+ uses: dataaxiom/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1.2.2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ packages: aerocore-os
+ older-than: 90 days
+ keep-n-tagged: 7
+ keep-n-untagged: 7
+ delete-orphaned-images: true
+ # Protect the rolling channel aliases, including the current Fedora-major aliases.
+ exclude-tags: '^(stable|latest|testing|stable-[0-9]+|testing-[0-9]+)$'
+ use-regex: true
+ dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || false }}