File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
cluster-template/launchpad-{{cookiecutter.cluster_slug_normalized}}-cluster/.github/workflows Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Cleanup Container Packages
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ RUNNER_WORKFLOW_LABEL :
7+ description : " The label of the runner workflow to run"
8+ required : false
9+ type : string
10+ default : " ubuntu-latest"
11+ MIN_VERSIONS_TO_KEEP :
12+ description : " Number of newest package versions to retain per GHCR package"
13+ required : false
14+ type : number
15+ default : 5
16+ PACKAGE_SUFFIXES_JSON :
17+ description : ' JSON array of package name suffixes (GHCR package is "<repo>/<suffix>")'
18+ required : false
19+ type : string
20+ default : ' ["openedx","mfe"]'
21+ DELETE_ONLY_UNTAGGED_VERSIONS :
22+ description : " If true, only untagged container versions are eligible for deletion"
23+ required : false
24+ type : boolean
25+ default : false
26+
27+ jobs :
28+ cleanup :
29+ name : Cleanup ${{ matrix.package_suffix }}
30+ runs-on : ${{ inputs.RUNNER_WORKFLOW_LABEL }}
31+ permissions :
32+ contents : read
33+ packages : write
34+ strategy :
35+ fail-fast : false
36+ matrix :
37+ package_suffix : ${{ fromJSON(inputs.PACKAGE_SUFFIXES_JSON) }}
38+ steps :
39+ - name : Cleanup registry
40+ uses : actions/delete-package-versions@v5
41+ with :
42+ package-name : ${{ github.event.repository.name }}/${{ matrix.package_suffix }}
43+ package-type : container
44+ min-versions-to-keep : ${{ inputs.MIN_VERSIONS_TO_KEEP }}
45+ delete-only-untagged-versions : ${{ inputs.DELETE_ONLY_UNTAGGED_VERSIONS }}
Original file line number Diff line number Diff line change 1+ name : Cleanup Container Packages
2+
3+ on :
4+ schedule :
5+ - cron : " 0 3 * * 0" # Sunday 03:00 UTC
6+ workflow_dispatch :
7+
8+ jobs :
9+ cleanup-container-packages :
10+ name : Cleanup container packages
11+ permissions :
12+ contents : read
13+ packages : write
14+ uses : open-craft/launchpad-cluster-template/.github/workflows/cleanup-container-packages.yml@main
15+ with :
16+ RUNNER_WORKFLOW_LABEL : " {{ cookiecutter.runner_workflow_label }}"
17+ MIN_VERSIONS_TO_KEEP : 5
18+ PACKAGE_SUFFIXES_JSON : ' ["openedx","mfe"]'
19+ DELETE_ONLY_UNTAGGED_VERSIONS : false
You can’t perform that action at this time.
0 commit comments