chore: add cleaning workflow ci
Some checks failed
Clean container registry / clean (devbox) (push) Failing after 2s
Some checks failed
Clean container registry / clean (devbox) (push) Failing after 2s
This commit is contained in:
parent
a14b838a0d
commit
8dcf500d79
1 changed files with 25 additions and 0 deletions
25
.forgejo/workflows/clean-containers.yml
Normal file
25
.forgejo/workflows/clean-containers.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
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)$'
|
||||||
|
token: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue