From 9cc0654f56a86bfbb7b558b873b2e35bdd3915d8 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Mon, 25 Sep 2023 20:28:49 +0200 Subject: [PATCH] Delete untagged images (#151) This change to the pipline deletes untagged / overwritten tags once a week to keep the memory consumption in the GH registry reasonable. --- .github/workflows/delete-branch.yaml | 11 ----------- .github/workflows/maintenance.yaml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) delete mode 100644 .github/workflows/delete-branch.yaml create mode 100644 .github/workflows/maintenance.yaml diff --git a/.github/workflows/delete-branch.yaml b/.github/workflows/delete-branch.yaml deleted file mode 100644 index 67dbbc8..0000000 --- a/.github/workflows/delete-branch.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Branch Deleted -on: delete -jobs: - delete: - if: github.event.ref_type == 'branch' - runs-on: ubuntu-latest - steps: - - name: Clean up - run: | - echo "Clean up for branch ${{ github.event.ref }}" - # uses: bots-house/ghcr-delete-image-action@v1.1.0 diff --git a/.github/workflows/maintenance.yaml b/.github/workflows/maintenance.yaml new file mode 100644 index 0000000..f402e7a --- /dev/null +++ b/.github/workflows/maintenance.yaml @@ -0,0 +1,18 @@ +name: Auto Maintenance Cycle + +on: + schedule: + - cron: 30 7 * * 1 + +jobs: + delete_all_untagged: + runs-on: ubuntu-latest + strategy: + matrix: + name: [ingest, data-transformation, web-server] + steps: + - name: purge packages + uses: dylanratcliffe/delete-untagged-containers@main + with: + package_name: ${{ github.event.repository.name }}/${{ matrix.name }} + token: ${{ secrets.GITHUB_TOKEN }}