diff --git a/.github/workflows/clean-images.yaml b/.github/workflows/clean-images.yaml new file mode 100644 index 0000000..bb329f6 --- /dev/null +++ b/.github/workflows/clean-images.yaml @@ -0,0 +1,24 @@ +name: Cleanup Old Images +on: + schedule: + - cron: "15 0 * * 0" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + +jobs: + delete-older-than-90: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: Delete Older Images + uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16 + with: + token: ${{ secrets.GITHUB_TOKEN }} + packages: distinctionos + older-than: 14 days + delete-orphaned-images: true + keep-n-tagged: 7 + keep-n-untagged: 7