From 4e81f1ba017a3d9c4ad4a24200b026991ca4b19f Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Thu, 9 May 2024 17:10:09 -0500 Subject: [PATCH] ci: Retention policy for docker prerelease tags Delete any `-dev.` prerelease tags older than a week. --- .github/workflows/docker-retention.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/docker-retention.yml diff --git a/.github/workflows/docker-retention.yml b/.github/workflows/docker-retention.yml new file mode 100644 index 00000000..2b33b174 --- /dev/null +++ b/.github/workflows/docker-retention.yml @@ -0,0 +1,25 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Docker Retention + +on: + workflow_dispatch: # TEMP + schedule: + - cron: '0 0 * * *' + +jobs: + retention: + name: Enforce Retention Policy + runs-on: ubuntu-latest + steps: + - name: Delete old pre-release images + uses: snok/container-retention-policy@v2 + with: + image-names: recyclarr + filter-tags: '*-dev.*' + cut-off: One week ago CST + keep-at-least: 1 + account-type: org + org-name: recyclarr + token: ${{ secrets.GITHUB_TOKEN }} + token-type: github-token + dry-run: true # TEMP