From 66ea1cdff2185f38fad4b1abb534b6d4263ba76e Mon Sep 17 00:00:00 2001 From: Jason Bonnell <166553723+jbonnell-amd@users.noreply.github.com> Date: Fri, 21 Nov 2025 08:49:29 -0500 Subject: [PATCH] Add workflow to remove old untagged rocprofiler GHCR Docker Images (#1959) * Add WIP workflow step to delete untagged images older than 1 week * Formatting fix for rocprofiler-systems-ghcr.yml * Move step to new workflow * Remove needs parameter from cleanup-rocprofiler-images * Remove expand-packages option * Expand cleanup for every OS * Revert spacing change to rocprofiler-systems-ghcr.yml * Turn off dry-run to do an initial clean * Switch dry-run to be only on PR * Added comment about schedule --- .../workflows/rocprofiler-ghcr-cleanup.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/rocprofiler-ghcr-cleanup.yml diff --git a/.github/workflows/rocprofiler-ghcr-cleanup.yml b/.github/workflows/rocprofiler-ghcr-cleanup.yml new file mode 100644 index 0000000000..e85e2a2c14 --- /dev/null +++ b/.github/workflows/rocprofiler-ghcr-cleanup.yml @@ -0,0 +1,29 @@ +name: rocprofiler GHCR Package Cleanup + +on: + workflow_dispatch: + schedule: + # Runs daily at 6 AM UTC, 1 hour after the GHCR containers are updated + - cron: 0 6 * * * + pull_request: + paths: + - '.github/workflows/rocprofiler-ghcr-cleanup.yml' + +jobs: + cleanup-rocprofiler-images: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + strategy: + matrix: + os: [ 'ubuntu', 'rhel', 'opensuse', 'debian' ] + + steps: + - name: Clean up GHCR rocprofiler-${{ matrix.os }} Docker CI Images + uses: dataaxiom/ghcr-cleanup-action@v1 + with: + package: rocprofiler-${{ matrix.os }} + older-than: 7 days + dry-run: ${{ github.event_name == 'pull_request' }}