Skip to content

Commit 07cfb8d

Browse files
authored
Add cleanup pipeline to remove unusable images (#51)
This PR adds a weekly cleanup job to remove untagged, orphaned, ghost, and partial images. Per the description at https://github.com/dataaxiom/ghcr-cleanup-action: * delete-untagged = Delete all untagged images * delete-ghost-images = Delete multi-architecture images where all underlying platform images are missing * delete-partial-images = Delete multi-architecture images where some (but not all) underlying platform images are missing * delete-orphaned-images = Delete tagged images which have no parent (e.g. referrers and cosign tags missing their parent)
1 parent b30e8e8 commit 07cfb8d

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/cleanup.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docker image cleanup
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/cleanup.yml
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/workflows/cleanup.yml
12+
schedule:
13+
- cron: "42 2 * * 0" # Run every Sunday at 02:42 UTC.
14+
workflow_dispatch:
15+
16+
jobs:
17+
cleanup:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
packages: write
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
image:
25+
- debian-bullseye
26+
- debian-bookworm
27+
- gcc
28+
- rhel-9.4
29+
- rhel-9.6
30+
- tools-rippled-clang-format
31+
- tools-rippled-documentation
32+
- tools-rippled-pre-commit
33+
- tools-rippled-prettier
34+
- ubuntu-jammy
35+
- ubuntu-noble
36+
steps:
37+
- name: Cleanup images in the GitHub Container Registry
38+
uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16
39+
with:
40+
delete-ghost-images: true
41+
delete-orphaned-images: true
42+
delete-partial-images: true
43+
delete-untagged: true
44+
dry-run: ${{ github.event_name == 'pull_request' }}
45+
package: ci/${{ matrix.image }}

0 commit comments

Comments
 (0)