Skip to content

Commit

Permalink
Try automated container cleaning.
Browse files Browse the repository at this point in the history
Work towards #50
  • Loading branch information
tpendragon committed Jul 29, 2024
1 parent a62c8ff commit bac9cd3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/clean-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
workflow_dispatch:
schedule:
- cron: "5 * * * *" # every hour
pull_request:
branches:
- main

jobs:
clean:
runs-on: ubuntu-latest
name: Delete old images
steps:
- name: Fetch multi-platform package version SHAs
id: multi-arch-digests
run: |
package1=$(docker manifest inspect ghcr.io/pulibrary | jq -r '.manifests.[] | .digest' | paste -s -d ' ' -)
echo "multi-arch-digests=$package1" >> $GITHUB_OUTPUT
- uses: snok/[email protected]
with:
account: pulibrary
token: ${{ secrets.GITHUB_TOKEN }}
image-names: "dpul-collections"
image-tags: "!main pr-* sha-*" # target any image that has a tag starting with the word test or dev
cut-off: 2w
keep-n-most-recent: 10
skip-shas: ${{ steps.multi-arch-digests.outputs.multi-arch-digests }}
dry-run: true

0 comments on commit bac9cd3

Please sign in to comment.