From 05b898774734bffc58eea3b633ba5365a0ca68b7 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 20 Mar 2022 19:12:47 +0100 Subject: [PATCH] ci: add docker image cleanup workflow This adds a daily CI workflow to delete old tags from the 'hedgedoc-ci' image. Signed-off-by: David Mehren --- .github/workflows/docker-cleanup.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/docker-cleanup.yml diff --git a/.github/workflows/docker-cleanup.yml b/.github/workflows/docker-cleanup.yml new file mode 100644 index 000000000..35d150080 --- /dev/null +++ b/.github/workflows/docker-cleanup.yml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) +# +# SPDX-License-Identifier: AGPL-3.0-only + +name: Delete old container images + +on: + schedule: + - cron: '0 0 * * *' # every day at midnight + workflow_dispatch: + +jobs: + clean-ghcr: + name: Cleanup CI containers + runs-on: ubuntu-latest + steps: + - name: Cleanup CI containers + uses: snok/container-retention-policy@v1 + with: + image-names: ${{ github.event.repository.name }}-ci + cut-off: A day ago UTC + account-type: org + org-name: ${{ github.repository_owner }} + token: ${{ secrets.PAT_IMAGE_CLEANUP }}