Skip to content

Commit 97ad4ee

Browse files
committed
Adds registry cleanup GitHub Action
1 parent c9d9ad2 commit 97ad4ee

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/cleanup.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Cleanup actions
2+
3+
on:
4+
schedule:
5+
- cron: '39 23 * * 1'
6+
# manual
7+
workflow_dispatch:
8+
9+
env:
10+
11+
# Use docker.io for Docker Hub if empty
12+
REGISTRY: ghcr.io
13+
14+
# github.repository as <account>/<repo>
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
permissions:
18+
packages: write
19+
20+
21+
jobs:
22+
23+
GHCR-io-cleanup-action:
24+
25+
runs-on: ubuntu-latest
26+
steps:
27+
# https://github.com/marketplace/actions/ghcr-io-cleanup-action
28+
- uses: dataaxiom/ghcr-cleanup-action@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
# https://github.com/dataaxiom/ghcr-cleanup-action?tab=readme-ov-file
32+
older-than: 6 months
33+
keep-n-tagged: 5
34+
delete-untagged: true
35+
dry-run: false
36+

0 commit comments

Comments
 (0)