Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clean-containers #71

Merged
merged 10 commits into from
Sep 2, 2024
22 changes: 9 additions & 13 deletions .github/workflows/clean-containers.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "Clean the old docker images"

on:
workflow_dispatch: # This line adds the manual trigger
workflow_dispatch: # Manual trigger
schedule:
- cron: "21 21 * * *"
- cron: "21 21 * * 0" # Scheduled run every Sunday at 21:21

jobs:
clean-ghcr:
Expand All @@ -13,19 +13,15 @@ jobs:
packages: write
env:
REGISTRY: ghcr.io

steps:
- name: downcase REPO name
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Delete 'PR' containers older than a week
uses: snok/[email protected]
with:
image-names: ${{ env.REGISTRY }}/${{ env.REPO }}
filter-tags: "sha-*,sha256:*"
skip-tags: latest
cut-off: "A week ago UTC"
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 1
account: sanctuuary
image-names: "!empty"
token: ${{ secrets.GH_REPO_TOKEN }}
timestamp-to-use: updated_at
image-tags: "!latest"
cut-off: 2w 3d
keep-n-most-recent: 2

Loading