forked from mac-zhou/midea-msmart
-
-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (46 loc) · 1.23 KB
/
prune-ghcr.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
name: Prune GHCR
on:
pull_request:
types: [closed]
schedule:
- cron: "20 4 * * 0"
workflow_dispatch:
env:
CONTAINER_NAME: msmart-ng
jobs:
prune-pr-images:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: vlaurin/[email protected]
with:
container: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
prune-tags-regexes: ^pr-${{github.event.pull_request.number}}
# dry-run: true
prune-old-images:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: vlaurin/[email protected]
with:
container: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
# Keep PRs, releases, latest and edge
keep-tags-regexes: |
^pr-
^\d+\.\d+\.\d+
keep-tags: |
edge
latest
# dry-run: true
- uses: dataaxiom/ghcr-cleanup-action@v1
with:
package: ${{ env.CONTAINER_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
# dry-run: true
validate: true