Skip to content

Cleanup GHCR Build Cache #46

Cleanup GHCR Build Cache

Cleanup GHCR Build Cache #46

Workflow file for this run

name: Cleanup GHCR Build Cache
# Prunes the *-buildcache GHCR packages used by .github/actions/build-cosmos.
# Keeps the most recent N tagged versions per package and deletes untagged
# manifests left behind when cache tags are overwritten.
on:
schedule:
- cron: "0 6 * * *" # daily at 06:00 UTC
workflow_dispatch:
permissions:
packages: write
jobs:
prune:
runs-on: ubuntu-latest
steps:
- name: Prune *-buildcache packages
# https://github.com/dataaxiom/ghcr-cleanup-action
uses: dataaxiom/ghcr-cleanup-action@f092b48ba3b604b2a83690dc4b2bbb3392e1045f # v1.2.1
with:
owner: openc3
# Wildcards enabled by expand-packages — matches every cache package
# created by .github/actions/build-cosmos in one shot.
packages: openc3-*-buildcache
expand-packages: true
# Keep enough headroom for in-flight PRs while preventing the cache
# backlog from growing unbounded.
keep-n-tagged: 50
delete-untagged: true
token: ${{ secrets.CLEANUP_GHCR_TOKEN }}