Skip to content

Commit

Permalink
Merge pull request #46 from Elenpay/feat/add_github_actions_docker_cl…
Browse files Browse the repository at this point in the history
…eanup

Adds Github Actions job to cleanup Docker registry old images
  • Loading branch information
Jossec101 authored Aug 29, 2023
2 parents 2e87000 + f499bc7 commit 68138b4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Github Container Registry cleanup tasks
on:
# On demand || Each 10 days
workflow_dispatch:
schedule:
- cron: '0 0 */10 * *'
jobs:
cleanup-docker:
runs-on: ubuntu-latest
steps:
- name: Prune untagged containers
uses: vlaurin/[email protected]
with:
token: ${{ github.token }}
organization: ${{ github.repository_owner }}
container: ${{ github.event.repository.name }}
prune-untagged: true
untagged: true
keep-last: 5

- name: Prune old containers (Dry-run)
uses: vlaurin/[email protected]
with:
token: ${{ github.token }}
organization: ${{ github.repository_owner }}
container: ${{ github.event.repository.name }}
dry-run: true # Dry-run first, then change to `false`
keep-younger-than: 365 # days
keep-last: 20
prune-tags-regexes: |
.*
keep-tags-regexes: |
^main$
^latest$

0 comments on commit 68138b4

Please sign in to comment.