GHCR image retention (#802)¶
Weekly workflow ghcr-retention.yml
prunes old container package versions for:
podcast-scraper-stack-apipodcast-scraper-stack-viewerpodcast-scraper-stack-pipeline-llmpodcast-scraper-stack-pipeline-ml
Keep set¶
Per image, versions are kept when any of the following apply:
| Rule | Rationale |
|---|---|
Latest 20 by created_at |
~3 weeks of daily pushes; enough for SHA rollback |
Tag matches v* |
Release tags kept indefinitely |
Tag main |
Current main HEAD image |
Tag sha-<short> from last 5 successful deploy-prod.yml runs |
Recent prod deploy history |
Everything else is eligible for deletion.
Operator workflow¶
- Dry-run (default):
make ghcr-prune-dry-runor dispatch workflow withdry_run=true. - Review stdout / job summary (keep vs delete counts).
- Apply: workflow_dispatch with
dry_run=falseandconfirm_apply=APPLY.
Cron (Sunday 04:00 UTC) runs dry-run only until the operator enables destructive mode on dispatch.
Local dry-run¶
make ghcr-prune-dry-run
Requires gh authenticated with read:packages and delete:packages (delete only when using
--apply).