Prune Images #56
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: Prune Images | |
permissions: | |
packages: write | |
env: | |
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
KEEP_LAST: 6 | |
PRUNE_REGEX: | | |
^\d+[.]\d+[.]\d+$ | |
^\d+[.]\d+[.]\d+_beta$ | |
DRYRUN: false | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' # Runs at 12:00 AM (midnight) every Sunday | |
jobs: | |
delete-untagged-images: | |
name: Delete Untagged Images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit | |
- name: Prune Dev | |
uses: vlaurin/action-ghcr-prune@0a539594d122b915e71c59733a5b115bfaaf5d52 # v0.5.0 | |
with: | |
container: dev | |
dry-run: ${{ env.DRYRUN }} | |
token: ${{ env.ACCESS_TOKEN }} | |
keep-last: ${{ env.KEEP_LAST }} | |
prune-untagged: true | |
- name: Prune Notebook | |
uses: vlaurin/action-ghcr-prune@0a539594d122b915e71c59733a5b115bfaaf5d52 # v0.5.0 | |
with: | |
container: notebook | |
dry-run: ${{ env.DRYRUN }} | |
token: ${{ env.ACCESS_TOKEN }} | |
keep-last: ${{ env.KEEP_LAST }} | |
prune-untagged: true | |
- name: Prune Rust | |
uses: vlaurin/action-ghcr-prune@0a539594d122b915e71c59733a5b115bfaaf5d52 # v0.5.0 | |
with: | |
container: rust | |
dry-run: ${{ env.DRYRUN }} | |
token: ${{ env.ACCESS_TOKEN }} | |
keep-last: ${{ env.KEEP_LAST }} | |
prune-untagged: true | |
- name: Prune Web | |
uses: vlaurin/action-ghcr-prune@0a539594d122b915e71c59733a5b115bfaaf5d52 # v0.5.0 | |
with: | |
container: web | |
dry-run: ${{ env.DRYRUN }} | |
token: ${{ env.ACCESS_TOKEN }} | |
keep-last: ${{ env.KEEP_LAST }} | |
prune-untagged: true | |
- name: Prune Gold | |
uses: vlaurin/action-ghcr-prune@0a539594d122b915e71c59733a5b115bfaaf5d52 # v0.5.0 | |
with: | |
container: gold | |
dry-run: ${{ env.DRYRUN }} | |
token: ${{ env.ACCESS_TOKEN }} | |
keep-last: ${{ env.KEEP_LAST }} | |
prune-untagged: true |