Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
purge old images. keep 5 more recent
Browse files Browse the repository at this point in the history
romeroalx committed Dec 15, 2023
1 parent 6631a44 commit ca6c62a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-debian-images.yaml
Original file line number Diff line number Diff line change
@@ -47,3 +47,29 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }}
purge-old-images:
name: Purge old images.
# if: ${{ github.event.schedule || github.event.workflow_dispatch }}
# Delete below
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
strategy:
matrix:
include:
- image-id: debian-11-pdns-base
- image-id: debian-12-pdns-base
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Get repository name
run: |
echo "repo-name=${{ github.repository }}" | cut -d '/' -f 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.debian-release-name }}
package-type: container
min-versions-to-keep: 5

0 comments on commit ca6c62a

Please sign in to comment.