-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.14 KB
/
ghcr-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
35
36
37
name: Delete old ghcr images
on:
schedule:
- cron: "15 1 * * *" # every day at 1:15am
pull_request:
types: [closed]
jobs:
pull-request-ghcr-cleanup:
if: ${{ github.event_name == 'pull_request' }}
name: Delete images related to closed PR
runs-on: ubuntu-latest
steps:
- name: Delete images related to closed PR
uses: snok/container-retention-policy@v2
with:
image-names: client-application
cut-off: now UTC
account-type: org
org-name: plgd-dev
filter-tags: vnext-pr${{ github.event.pull_request.number }}*
token: ${{ secrets.GHCR_CLEANUP_PAT }}
nightly-ghcr-cleanup:
if: ${{ github.event_name == 'schedule' }}
name: Delete old vnext images
runs-on: ubuntu-latest
steps:
- name: Delete older than a month vnext images
uses: snok/container-retention-policy@v2
with:
image-names: client-application
cut-off: One month ago UTC
account-type: org
org-name: plgd-dev
filter-tags: vnext-*
skip-tags: vnext-pr*, main
token: ${{ secrets.GHCR_CLEANUP_PAT }}