Skip to content

Github Container Registry cleanup tasks #11

Github Container Registry cleanup tasks

Github Container Registry cleanup tasks #11

Workflow file for this run

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$