Skip to content

Commit

Permalink
Merge pull request #71 from sanctuuary/update_gh_action
Browse files Browse the repository at this point in the history
Fix clean-containers
  • Loading branch information
vedran-kasalica authored Sep 2, 2024
2 parents 6fec528 + a450b2a commit 8ec5903
Showing 1 changed file with 9 additions and 13 deletions.
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

0 comments on commit 8ec5903

Please sign in to comment.