Skip to content

Commit 9dcd6d5

Browse files
authored
ci: add automated image cleanup
Automatically cleanup old images when a new build is pushed. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 854ad6a commit 9dcd6d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/image.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ jobs:
4444
ghcr.io/${{ github.repository }}:${{ github.sha }}
4545
cache-from: type=gha
4646
cache-to: type=gha,mode=max
47+
48+
cleanup:
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Delete old images
53+
uses: actions/delete-package-versions@v5
54+
with:
55+
package-name: ${{ github.event.repository.name }}
56+
package-type: 'container'
57+
min-versions-to-keep: 3
58+
ignore-versions: '^latest$'

0 commit comments

Comments
 (0)