-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.67 KB
/
cleanup_and_maintainance.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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/[email protected]
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/[email protected]
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@v9
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