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

Try automated container cleaning. #61

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/clean-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_dispatch:
schedule:
- cron: "5 * * * *" # every hour

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/dpul-collections:main | 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 }}
Loading