Clean old Docker images #25
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: Clean old Docker images | |
| on: | |
| schedule: | |
| - cron: '0 7 * * 1' # Every monday at 7am | |
| workflow_dispatch: # Allow triggering this pipeline manually | |
| jobs: | |
| clean: | |
| name: Docker images clean | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Delete old production images | |
| uses: dataaxiom/ghcr-cleanup-action@v1 | |
| with: | |
| owner: betagouv | |
| packages: etabli/etabli-main | |
| keep-n-tagged: 5 | |
| exclude-tags: latest | |
| older-than: 1 week | |
| delete-untagged: true # safe to enable: children of kept tags are auto-protected | |
| delete-orphaned-images: true # drop SLSA / cosign manifests whose parent was deleted | |
| validate: true # post-run sanity check that no kept tag was broken | |
| # - name: Delete old development images | |
| # uses: dataaxiom/ghcr-cleanup-action@v1 | |
| # with: | |
| # owner: betagouv | |
| # packages: etabli/etabli-dev | |
| # keep-n-tagged: 5 | |
| # exclude-tags: latest | |
| # older-than: 1 week | |
| # delete-untagged: true | |
| # delete-orphaned-images: true | |
| # validate: true |