diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 0000000..4b8d576 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,29 @@ +name: Cleaner + +on: + workflow_dispatch: + # schedule: + # - cron: "0 0 * * *" + pull_request: + branches: + - "dev" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - uses: actions/delete-package-versions@v5 + with: + package-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + package-type: docker + min-versions-to-keep: 10 + ignore-versions: '(v\d+\.\d+\.\d+|latest)'