-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add manual workflow to cleanup ghcr images
This workflow is necessary to avoid having too many docker images in the registry (it grows fast!). It should be triggered manually once in a while.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Cleanup Docker Registry | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dryRun: | ||
type: boolean | ||
default: true | ||
description: Do not perform the cleanup | ||
days: | ||
type: string | ||
default: '7' | ||
description: Retention in days | ||
untagged: | ||
type: boolean | ||
default: true | ||
description: Delete untagged images | ||
sha: | ||
type: boolean | ||
default: true | ||
description: Delete main-<sha> and develop-<sha> tags | ||
|
||
jobs: | ||
release_grun: | ||
name: Cleanup Registry (dry-run=${{ inputs.dryRun }}, untagged=${{ inputs.untagged }}, sha=${{ inputs.sha }}) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prune | ||
uses: vlaurin/action-ghcr-prune@main | ||
with: | ||
# The PAT should have scopes repo + packages:delete | ||
token: ${{ secrets.PAT_CLEANUP_PACKAGES }} | ||
user: derlin | ||
container: rickroller | ||
dry-run: ${{ inputs.dryRun }} | ||
older-than: ${{ inputs.days }} | ||
untagged: ${{ inputs.untagged }} | ||
tag-regex: ${{ inputs.sha && '^(develop|main)-[0-9a-f]{7}$' || '' }} | ||
keep-tags-regexes: | | ||
^latest$ | ||
^\d+(\.\d+){0,3}$ |
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