Skip to content

Commit

Permalink
Clean up container images on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
zimmski committed Jan 17, 2025
1 parent 2e703fa commit 256a2ff
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ concurrency:
cancel-in-progress: true

jobs:
docker:
name: 'Run docker image building'
uses: ./.github/workflows/job-docker.yml
container-build:
name: 'Build container images'
uses: ./.github/workflows/job-container-image-build.yml
container-cleanup:
name: 'Clean up container images'
uses: ./.github/workflows/job-container-image-cleanup.yml
lint:
name: 'Lint the repository'
uses: ./.github/workflows/job-lint.yml
test:
name: 'Run tests and lint artifacts'
needs:
- docker
- container-build
- lint
secrets: inherit
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in Github packages
- name: Log in GitHub packages
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/job-container-image-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:

jobs:
delete_branch_container_versions:
runs-on: ubuntu-latest
steps:
- name: Delete branch container versions
uses: vlaurin/[email protected]
with:
container: eval-dev-quality
keep-tags-regexes: |
^[1-9]\d*\.\d+.\d+$
keep-younger-than: 14 # In days.
organization: symflower
prune-tags-regexes: |
^.+$
token: ${{ github.token }}
delete_untagged_container_versions:
runs-on: ubuntu-latest
steps:
- name: Delete untagged container versions
uses: vlaurin/[email protected]
with:
container: eval-dev-quality
keep-younger-than: 14 # In days.
organization: symflower
prune-untagged: true
token: ${{ github.token }}

0 comments on commit 256a2ff

Please sign in to comment.