Cleanup and Maintainance #108
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 and Maintainance" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "19 23 * * 1" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ ( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release' ) && format('ci-master-{0}', github.sha) || format('ci-master-{0}', github.ref) }} | |
| cancel-in-progress: true | |
| jobs: | |
| dockercleanup: | |
| runs-on: ubuntu-latest | |
| name: "Pruning Untagged Images" | |
| steps: | |
| - name: "Older than 1 week" | |
| # https://github.com/marketplace/actions/ghcr-pruning | |
| uses: vlaurin/action-ghcr-prune@v0.6.0 | |
| with: | |
| token: ${{ secrets.GHCR_CLEANUP_PAT }} | |
| organization: B3Partners | |
| container: planmonitor-wonen-api | |
| dry-run: false | |
| keep-younger-than: 7 | |
| keep-last: 1 | |
| prune-untagged: true | |
| - name: "Older than 4 weeks" | |
| uses: vlaurin/action-ghcr-prune@v0.6.0 | |
| with: | |
| token: ${{ secrets.GHCR_CLEANUP_PAT }} | |
| organization: B3Partners | |
| container: planmonitor-wonen-api | |
| dry-run: false | |
| keep-younger-than: 28 | |
| keep-last: 0 | |
| prune-untagged: true | |
| stale: | |
| runs-on: ubuntu-latest | |
| name: Close Stale PRs | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/stale@v10 | |
| with: | |
| days-before-stale: 60 | |
| days-before-close: 10 | |
| workflows: | |
| runs-on: ubuntu-latest | |
| name: Cleanup old workflow runs | |
| steps: | |
| - name: Delete workflow runs | |
| uses: Mattraks/delete-workflow-runs@v2 | |
| with: | |
| token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| retain_days: 90 | |
| keep_minimum_runs: 2 |