-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (63 loc) · 2.06 KB
/
prune.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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