Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit bc1ae9b

Browse files
Merge pull request #271 from sanger/dpl-785-remove-old-releases
Dpl 785 remove old releases
2 parents e370d31 + b3f8bf2 commit bc1ae9b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/docker.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
env:
1313
IMAGE_NAME: ${{ github.repository }}/${{ github.event.repository.name }}
1414

15+
permissions:
16+
packages: write
17+
1518
jobs:
1619
build_and_publish:
1720
runs-on: ubuntu-latest
@@ -39,3 +42,15 @@ jobs:
3942
- name: Publish image (latest)
4043
run: docker push docker.pkg.github.com/${IMAGE_NAME}:latest
4144
if: github.ref == 'refs/heads/master'
45+
46+
- name: Remove old releases
47+
uses: snok/container-retention-policy@v2
48+
with:
49+
image-names: ${{ github.event.repository.name }}/*
50+
cut-off: Ten months ago UTC
51+
timestamp-to-use: updated_at
52+
account-type: org
53+
org-name: sanger
54+
keep-at-least: 5
55+
skip-tags: latest
56+
token: ${{ secrets.REMOVE_OLD_IMAGES }}

0 commit comments

Comments
 (0)