forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.17 KB
/
Copy pathcleanup-ghcr-images.yml
File metadata and controls
38 lines (34 loc) · 1.17 KB
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
38
# Cleanup GHCR Images
#
# This workflow cleans up old images from GitHub Container Registry
# to prevent unlimited storage growth. It runs weekly and removes:
# 1. Untagged images from all packages (intermediate build artifacts)
# 2. Old test-runner versions (keeps 50 most recent, deletes up to 50 oldest)
name: Cleanup Untagged GHCR Images
on:
schedule:
# Run weekly on Sundays at 2 AM UTC
- cron: '0 2 * * 0'
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Delete untagged vector images
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
with:
package-name: vector
package-type: container
min-versions-to-keep: 0
delete-only-untagged-versions: true
continue-on-error: true
- name: Delete old vector-test-runner images
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
with:
package-name: test-runner
package-type: container
min-versions-to-keep: 5
num-old-versions-to-delete: 50