Github Container Registry cleanup tasks #2
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: Github Container Registry cleanup tasks | |
on: | |
# On demand || Each 10 days | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 */10 * *' | |
jobs: | |
cleanup-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prune untagged containers | |
uses: vlaurin/[email protected] | |
with: | |
token: ${{ github.token }} | |
organization: ${{ github.repository_owner }} | |
container: ${{ github.event.repository.name }} | |
prune-untagged: true | |
untagged: true | |
keep-last: 5 | |
- name: Prune old containers (Dry-run) | |
uses: vlaurin/[email protected] | |
with: | |
token: ${{ github.token }} | |
organization: ${{ github.repository_owner }} | |
container: ${{ github.event.repository.name }} | |
dry-run: true # Dry-run first, then change to `false` | |
keep-younger-than: 365 # days | |
keep-last: 20 | |
prune-tags-regexes: | | |
.* | |
keep-tags-regexes: | | |
^main$ | |
^latest$ |