Clean the old docker images #333
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Clean the old docker images" | |
on: | |
workflow_dispatch: # Manual trigger | |
schedule: | |
- cron: "21 21 * * 0" # Scheduled run every Sunday at 21:21 | |
jobs: | |
clean-ghcr: | |
name: Delete old unused container images | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
steps: | |
- name: Delete 'PR' containers older than a week | |
uses: snok/container-retention-policy@v3.0.0 | |
with: | |
account: sanctuuary | |
image-names: "!empty" | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
image-tags: "!latest" | |
cut-off: 2w 3d | |
keep-n-most-recent: 2 | |