Cleanup Untagged GHCR Images #1147
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 Untagged GHCR Images | |
on: | |
workflow_dispatch: # Manually | |
schedule: | |
- cron: '0 0 * * *' # Every day at midnight | |
jobs: | |
purge-untagged-images: | |
name: Delete image from ghcr.io | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
app: | |
- met-anomalycor | |
- met-cyclone | |
- met-ensemble | |
- met-object | |
- met-precip | |
- met-surface | |
- met-upperair | |
steps: | |
- name: Delete image | |
uses: snok/container-retention-policy@v2.2.1 | |
with: | |
image-names: metexpress/development/${{ matrix.app }} | |
cut-off: 1 week ago MST | |
account-type: org | |
org-name: dtcenter | |
untagged-only: true | |
token: ${{ secrets.GHCR_CLEANUP_PAT }} |