-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[packages]: Implement celanup action in dry-run mode
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |