container pruning
Docker / build (push) Has been cancelled Details

This commit is contained in:
Chris W 2024-01-07 12:15:56 -07:00
parent 01fb80644c
commit 959ea65508
1 changed files with 29 additions and 0 deletions

29
.github/workflows/docker-prune.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Prune Containers
on:
schedule:
- cron: '33 6 * * *' # 6:33 UTC every day
workflow_dispatch:
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Prune
uses: vlaurin/action-ghcr-prune@v0.5.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
organization: ${{ github.actor }}
container: ${{ env.IMAGE_NAME }}
dry-run: true # Dry-run first, then change to `false`
keep-younger-than: 2 # days
keep-last: 2
prune-untagged: true