Skip to content

Commit

Permalink
purge old images. keep 5 more recent
Browse files Browse the repository at this point in the history
  • Loading branch information
romeroalx committed Dec 15, 2023
1 parent 6631a44 commit 81fa364
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-debian-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,28 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }}
purge-old-images:
name: Purge old PDNS CI images
needs: build-and-push-debian-images
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
permissions:
contents: read
packages: write
strategy:
matrix:
image-id:
- debian-11-pdns-base
- debian-12-pdns-base
steps:
- name: Get repository name
run: |
echo "${{ github.repository }}" | awk -F'/' '{print "repo-name="$2}' >> "$GITHUB_ENV"
- name: Purge old images keeping the 5 more recent ones
uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.repo-name }}/${{ matrix.image-id }}
package-type: container
min-versions-to-keep: 5

0 comments on commit 81fa364

Please sign in to comment.