Skip to content

Commit

Permalink
feat[packages]: Implement celanup action in dry-run mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sidey79 committed Jul 23, 2024
1 parent 33a2134 commit 363ce78
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/registryCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Delete old container images

on:
workflow_dispatch:
# schedule:
# - cron: "0 0 * * *" # every day at midnight
pull_request:
branches: [ dev ]

jobs:
delete-package-versions:
name: Delete package versions older than 4 weeks, but keep the latest 5 in case of rollbacks
runs-on: ubuntu-latest
steps:
- uses: snok/[email protected]
with:
account: ${{ github.repository_owner }}
token: ${{ secrets.GITHUB_TOKEN }}
image-names: "fhem-docker fhem-minimal-docker" # select three packages
image-tags: "dev !latest pr*" # any image tag
tag-selection: both # select both tagged and untagged package versions
cut-off: 6w # package versions should be older than 4 weeks
keep-n-most-recent: 5 # keep up to `n` tagged package versions for each of the packages
dry-run: true

0 comments on commit 363ce78

Please sign in to comment.