♻ Cleanup GHCR #22
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
--- | |
name: "♻ Cleanup GHCR" | |
on: | |
schedule: | |
- cron: "0 0 * * 0" # At 00:00 on Sunday. | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'Reason for manual trigger' | |
required: true | |
default: 'Manual trigger' | |
jobs: | |
clean-ghcr: | |
name: cleanup images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete old container images | |
uses: snok/container-retention-policy@v3.0.0 | |
id: retention | |
with: | |
image-names: "debian debian.python debian.staging ubuntu-cross-s390x ubuntu-cross-ppc64le ubuntu-cross-armhf" | |
cut-off: 1w | |
keep-at-least: 1 | |
timestamp-to-use: updated_at | |
skip-tags: latest | |
account: linux-nvme | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print Output | |
run: |- | |
echo "Failed cleanup for = ${{ steps.retention.outputs.failed }}" | |
echo "Needs manual cleanup = ${{ steps.retention.outputs.needs-github-assistance }}" |