1111 name : Delete images related to closed PR
1212 runs-on : ubuntu-latest
1313 steps :
14- - name : Delete images related to closed PR
14+ - name : Delete images related to closed PR (1)
15+ id : run-1
16+ continue-on-error : true
1517 uses : snok/container-retention-policy@v2
1618 with :
1719 image-names : client-application
@@ -20,18 +22,52 @@ jobs:
2022 org-name : plgd-dev
2123 filter-tags : vnext-pr${{ github.event.pull_request.number }}*
2224 token : ${{ secrets.GHCR_CLEANUP_PAT }}
23- nightly-ghcr-cleanup :
24- if : ${{ github.event_name == 'schedule' }}
25- name : Delete old vnext images
26- runs-on : ubuntu-latest
27- steps :
28- - name : Delete older than a month vnext images
25+ - name : Delete images related to closed PR (2)
26+ id : run-2
27+ if : ${{ steps.run-1.outcome == 'failure' }}
28+ continue-on-error : true
29+ uses : snok/container-retention-policy@v2
30+ with :
31+ image-names : client-application
32+ cut-off : now UTC
33+ account-type : org
34+ org-name : plgd-dev
35+ filter-tags : vnext-pr${{ github.event.pull_request.number }}*
36+ token : ${{ secrets.GHCR_CLEANUP_PAT }}
37+ - name : Delete images related to closed PR (3)
38+ if : ${{ steps.run-2.outcome == 'failure' }}
2939 uses : snok/container-retention-policy@v2
3040 with :
3141 image-names : client-application
32- cut-off : One month ago UTC
42+ cut-off : now UTC
3343 account-type : org
3444 org-name : plgd-dev
35- filter-tags : vnext-*
36- skip-tags : vnext-pr*, main
37- token : ${{ secrets.GHCR_CLEANUP_PAT }}
45+ filter-tags : vnext-pr${{ github.event.pull_request.number }}*
46+ token : ${{ secrets.GHCR_CLEANUP_PAT }}
47+ nightly-ghcr-cleanup :
48+ if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
49+ name : Delete stale or untagged images
50+ runs-on : ubuntu-latest
51+ steps :
52+ - name : Checkout local actions
53+ uses : actions/checkout@v4
54+ - name : Delete stale or untagged images (1)
55+ id : run-1
56+ continue-on-error : true
57+ uses : ./.github/actions/cleanup-stale
58+ with :
59+ token : ${{ secrets.GHCR_CLEANUP_PAT }}
60+ - name : Delete stale or untagged images (2)
61+ id : run-2
62+ if : ${{ steps.run-1.outcome == 'failure' }}
63+ with :
64+ token : ${{ secrets.GHCR_CLEANUP_PAT }}
65+ delay : 60
66+ continue-on-error : true
67+ uses : ./.github/actions/cleanup-stale
68+ - name : Delete stale or untagged images (3)
69+ if : ${{ steps.run-2.outcome == 'failure' }}
70+ uses : ./.github/actions/cleanup-stale
71+ with :
72+ token : ${{ secrets.GHCR_CLEANUP_PAT }}
73+ delay : 60
0 commit comments