-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.23 KB
/
container-retention.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
name: Cleanup GHCR Images
on:
workflow_dispatch: # Manually
schedule:
- cron: '0 23 * * *' # Every day at an hour to midnight
jobs:
purge-images:
name: Delete images from ghcr.io
runs-on: ubuntu-latest
steps:
- name: Delete sha-* images over two weeks old
uses: snok/container-retention-policy@v2
with:
image-names: vxdataprocessor
cut-off: 2 weeks ago MST
account-type: org
org-name: noaa-gsl
filter-tags: sha-*
keep-at-least: 10
token: ${{ secrets.GHCR_CLEANUP_PAT }}
- name: Delete pr-* images over two weeks old
uses: snok/container-retention-policy@v2
with:
image-names: vxdataprocessor
cut-off: 2 weeks ago MST
account-type: org
org-name: noaa-gsl
filter-tags: pr-*
token: ${{ secrets.GHCR_CLEANUP_PAT }}
- name: Delete branch images over two weeks old
uses: snok/container-retention-policy@v2
with:
image-names: vxdataprocessor
cut-off: 2 weeks ago MST
account-type: org
org-name: noaa-gsl
skip-tags: latest, v*, pr-*, sha-*, main
token: ${{ secrets.GHCR_CLEANUP_PAT }}