From ed2967153de4352f46d1136db2e0335019ab047c Mon Sep 17 00:00:00 2001 From: aleidk Date: Tue, 5 Nov 2024 16:35:40 -0300 Subject: [PATCH] chore: add cleaning workflow ci --- .forgejo/workflows/clean-containers.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .forgejo/workflows/clean-containers.yml diff --git a/.forgejo/workflows/clean-containers.yml b/.forgejo/workflows/clean-containers.yml new file mode 100644 index 0000000..60f51c7 --- /dev/null +++ b/.forgejo/workflows/clean-containers.yml @@ -0,0 +1,24 @@ +name: Clean container registry +on: + push: + workflow_dispatch: +jobs: + clean: + runs-on: docker + strategy: + matrix: + box: + - "devbox" + steps: + - name: Get timestamp + id: timestamp + run: | + echo "year=$(date +'%Y-%m')" >> $GITHUB_OUTPUT + echo "current_month=$(date +'%Y-%m')" >> $GITHUB_OUTPUT + - uses: actions/delete-package-versions@v5 + with: + package-name: ${{matrix.box}} + package-type: 'container' + min-version-to-keep: 3 + # ignore latest and this month uploads + ignore-versions: '^(?:latest)$'