diff --git a/.github/workflows/cleanup_images.yaml b/.github/workflows/cleanup_images.yaml deleted file mode 100644 index d2847d9c..00000000 --- a/.github/workflows/cleanup_images.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Remove old GHCR.io Images' - -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - -jobs: - cleanup-images: - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Cleanup old images - uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16 - with: - package: tools-api - exclude-tags: latest,main,v* - keep-n-tagged: 5 - delete-untagged: true - delete-partial-images: true - older-than: 5 days diff --git a/.github/workflows/container_image.yaml b/.github/workflows/container_image.yaml index 8f536393..32ca6a22 100644 --- a/.github/workflows/container_image.yaml +++ b/.github/workflows/container_image.yaml @@ -70,3 +70,15 @@ jobs: BUILD_TIMESTAMP=${{ steps.vars.outputs.build_timestamp }} GIT_REF=${{ github.ref_name }} + - name: Set package name + id: package + run: echo "name=$(basename '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + - name: Cleanup old images + uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16 + with: + package: ${{ steps.package.outputs.name }} + exclude-tags: latest,main,v* + keep-n-tagged: 5 + delete-untagged: true + delete-partial-images: true \ No newline at end of file