diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 0000000..9c2fe61 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,45 @@ +name: Docker image cleanup + +on: + pull_request: + paths: + - .github/workflows/cleanup.yml + push: + branches: + - main + paths: + - .github/workflows/cleanup.yml + schedule: + - cron: "42 2 * * 0" # Run every Sunday at 02:42 UTC. + workflow_dispatch: + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + packages: write + strategy: + fail-fast: false + matrix: + image: + - debian-bullseye + - debian-bookworm + - gcc + - rhel-9.4 + - rhel-9.6 + - tools-rippled-clang-format + - tools-rippled-documentation + - tools-rippled-pre-commit + - tools-rippled-prettier + - ubuntu-jammy + - ubuntu-noble + steps: + - name: Cleanup images in the GitHub Container Registry + uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16 + with: + delete-ghost-images: true + delete-orphaned-images: true + delete-partial-images: true + delete-untagged: true + dry-run: ${{ github.event_name == 'pull_request' }} + package: ci/${{ matrix.image }}