Skip to content

Cleanup Container Registry #8

Cleanup Container Registry

Cleanup Container Registry #8

Workflow file for this run

# .github/workflows/cleanup-ghcr.yml
name: Cleanup Container Registry
on:
# Run this workflow automatically every Sunday at 02:00 UTC
schedule:
- cron: '0 2 * * 0'
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
cleanup-images:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
image-name: [stac-fastapi-pgstac-pair-search] # List of image names to clean up
steps:
- name: Delete old container image versions
uses: snok/container-retention-policy@v2
with:
image-names: ${{ matrix.image-name }}
cut-off: One day ago UTC
account-type: org
org-name: eox-a
keep-at-least: 5
skip-tags: '^(latest|\d+\.\d+(\.\d+)?|\d{4}\.\d{1,2}\.\d{1,2})$'
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token