-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (46 loc) · 1.7 KB
/
packages_retention.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Retention policy for web GHCR docker packages
on:
schedule:
- cron: '30 4 * * *' # Running everyday at 04:30 AM
workflow_dispatch:
jobs:
cleanup-packages:
name: Cleanup old GHCR docker packages
runs-on: ubuntu-latest
steps:
- name: Cleanup web outdated PR packages
uses: snok/container-retention-policy@v2
with:
image-names: ${{ github.event.repository.name }}-web
cut-off: 1 day ago UTC
timestamp-to-use: created_at
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 0
untagged-only: true
token: ${{ secrets.SNOK_RETENTION_GITHUB_TOKEN }}
- name: Cleanup web latest but old PR packages
uses: snok/container-retention-policy@v2
with:
image-names: ${{ github.event.repository.name }}-web
cut-off: 3 days ago UTC
timestamp-to-use: created_at
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 0
filter-include-untagged: false
filter-tags: pr-*
token: ${{ secrets.SNOK_RETENTION_GITHUB_TOKEN }}
- name: Cleanup web outdated master packages
uses: snok/container-retention-policy@v2
with:
image-names: ${{ github.event.repository.name }}-web
cut-off: 2 days ago UTC
timestamp-to-use: created_at
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 0
filter-include-untagged: false
filter-tags: master-*
skip-tags: master # Don't remove the newest master image
token: ${{ secrets.SNOK_RETENTION_GITHUB_TOKEN }}