Skip to content

Commit fafb16d

Browse files
authored
Merge pull request #394 from symflower/cleanup
Clean up container images on GitHub
2 parents c8ced26 + 084252a commit fafb16d

File tree

7 files changed

+47
-7
lines changed

7 files changed

+47
-7
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 }}

.github/workflows/job-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Install Symflower license
4949
run: |
50-
go run scripts/gitlab-ci-symflower-license/main.go
50+
go run scripts/github-ci-symflower-license/main.go
5151
shell: bash # Explicitly use Bash because otherwise failing Windows jobs are not erroring.
5252

5353
- name: Build
@@ -62,7 +62,7 @@ jobs:
6262
- name: Install testing tools
6363
run: |
6464
make install-tools-testing
65-
go run scripts/gitlab-ci/main.go
65+
go run scripts/github-ci/main.go
6666
shell: bash # Explicitly use Bash because otherwise failing Windows jobs are not erroring.
6767

6868
- name: Lint Build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
33
#
44
# Binaries for programs and plugins
5+
/bin
56
*.exe
67
*.exe~
78
*.dll
File renamed without changes.

0 commit comments

Comments
 (0)