-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.17 KB
/
ghcr-actions.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: ghcr actions
on:
schedule:
- cron: '21 21 * * *'
jobs:
clean-ghcr:
name: Delete old unused container images
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Delete 'PR' containers older than a week
uses: snok/[email protected]
with:
image-names: sda-doa
filter-tags: PR*, sha-*
cut-off: A week ago UTC
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 1
token: ${{ secrets.GITHUB_TOKEN }}
- name: Delete all containers older than treee months, using a wildcard
uses: snok/[email protected]
with:
image-names: sda-doa
filter-tags: v*
cut-off: Three months ago UTC
account-type: org
org-name: ${{ github.repository_owner }}
keep-at-least: 2
skip-tags: latest
token: ${{ secrets.GITHUB_TOKEN }}