Cleanup PR Docker Images #5
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 PR Docker Images | |
| on: | |
| schedule: | |
| - cron: "0 4 * * 0" # Weekly, Sundays at 4 AM UTC | |
| workflow_dispatch: | |
| jobs: | |
| cleanup: | |
| name: Delete old PR images | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Delete PR images older than 14 days | |
| uses: snok/container-retention-policy@v3.0.1 | |
| with: | |
| account: alan-turing-institute | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| image-names: "assuranceplatform/tea-app" | |
| tag-selection: "both" | |
| cut-off: "14 days ago UTC" | |
| keep-n-most-recent: 3 | |
| filter-tags: "pr-*" |