-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (33 loc) · 1.01 KB
/
cleanup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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$