From c6da302742f3cd0990465274f29a1e425f97e5a4 Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Thu, 19 Mar 2026 13:49:21 -0500 Subject: [PATCH] chore(ci): add GHCR cleanup job to delete old container image versions Each push creates a ~770MB container image tagged with the commit SHA. Add a cleanup job that runs after integration tests complete, keeping only the most recent version and deleting all others. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/integration-tests.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index b41ef1d..9ade554 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -89,6 +89,22 @@ jobs: push: true tags: ${{ env.TEST_IMAGE }}:${{ github.sha }},${{ env.TEST_IMAGE }}:latest + # ── Clean up old container images from GHCR ────────────────────────── + cleanup-images: + needs: integration + if: always() + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Delete old container image versions + uses: actions/delete-package-versions@v5 + with: + package-name: psproxmoxve-integration + package-type: container + min-versions-to-keep: 1 + delete-only-untagged-versions: false + token: ${{ secrets.GITHUB_TOKEN }} + # ── Integration tests (self-hosted runner in Docker container) ─────── integration: needs: [build, container-image]