Cleanup Old SAP-EE Containers #3
This file contains hidden or 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 Old SAP-EE Containers | |
| # Token: GITHUB_TOKEN funktioniert nicht ("missing field `id`", siehe | |
| # https://github.com/snok/container-retention-policy/issues/119). Es wird ein klassischer PAT | |
| # benötigt. Anleitung: siehe DEVELOPER.md Abschnitt "Cleanup-Workflow (GHCR)". | |
| on: | |
| # Erlaube manuelles Starten über die GitHub UI | |
| workflow_dispatch: | |
| # Einmal pro Monat (am 1. des Monats um 3:00 UTC) | |
| schedule: | |
| - cron: '0 3 1 * *' | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # Caution may have issues with multiarch images - see https://github.com/snok/container-retention-policy?tab=readme-ov-file#examples | |
| - name: Delete old sap-ee container images | |
| uses: snok/container-retention-policy@v3.0.1 | |
| with: | |
| # Für Organisation: Org-Name; für User-Repos: wörtlich "user" (laut Action-Doku) | |
| account: ${{ github.event.repository.owner.type == 'User' && 'user' || github.repository_owner }} | |
| # Klassischer PAT mit read:packages + delete:packages (GITHUB_TOKEN funktioniert nicht) | |
| token: ${{ secrets.GHCR_CLEANUP_TOKEN }} | |
| image-names: sap-ee | |
| image-tags: "dev*" | |
| cut-off: 6w | |
| keep-n-most-recent: 5 | |
| dry-run: false |