Skip to content

Commit 8678124

Browse files
committed
Clean up container images on GitHub
1 parent 2e703fa commit 8678124

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
docker:
11-
name: 'Run docker image building'
12-
uses: ./.github/workflows/job-docker.yml
10+
container-build:
11+
name: 'Build container images'
12+
uses: ./.github/workflows/job-container-image-build.yml
13+
container-cleanup:
14+
name: 'Clean up container images'
15+
uses: ./.github/workflows/job-container-image-cleanup.yml
1316
lint:
1417
name: 'Lint the repository'
1518
uses: ./.github/workflows/job-lint.yml
1619
test:
1720
name: 'Run tests and lint artifacts'
1821
needs:
19-
- docker
22+
- container-build
2023
- lint
2124
secrets: inherit
2225
strategy:

.github/workflows/job-docker.yml renamed to .github/workflows/job-container-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Docker Buildx
1515
uses: docker/setup-buildx-action@v3
1616

17-
- name: Log in Github packages
17+
- name: Log in GitHub packages
1818
uses: docker/login-action@v3
1919
with:
2020
registry: ghcr.io
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
container:
5+
default: eval-dev-quality
6+
type: string
7+
organization:
8+
default: symflower
9+
type: string
10+
11+
jobs:
12+
delete_branch_container_versions:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Delete branch container versions
16+
uses: vlaurin/[email protected]
17+
with:
18+
container: ${{ inputs.container }}
19+
keep-tags-regexes: |
20+
^[1-9]\d*\.\d+.\d+$
21+
keep-younger-than: 14 # In days.
22+
organization: ${{ inputs.organization }}
23+
prune-tags-regexes: |
24+
^.+$
25+
token: ${{ github.token }}
26+
delete_untagged_container_versions:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Delete untagged container versions
30+
uses: vlaurin/[email protected]
31+
with:
32+
container: ${{ inputs.container }}
33+
keep-younger-than: 1 # In days.
34+
organization: ${{ inputs.organization }}
35+
prune-untagged: true
36+
token: ${{ github.token }}

0 commit comments

Comments
 (0)