paste69/.github/workflows/docker-prune.yml

35 lines
922 B
YAML
Raw Normal View History

2024-01-07 19:20:48 +00:00
name: Prune containers
2024-01-07 19:15:56 +00:00
on:
2024-01-07 19:20:48 +00:00
workflow_call:
inputs:
container:
type: string
required: true
description: "Container name without organization"
older-than:
type: number
default: 14
description: "Prune containers older than X days"
keep-last:
type: number
default: 3
description: "Keep last X containers"
secrets:
token:
required: true
description: "Private access token with packages read/delete permission"
2024-01-07 19:15:56 +00:00
jobs:
2024-01-07 19:20:48 +00:00
prune:
2024-01-07 19:15:56 +00:00
runs-on: ubuntu-latest
steps:
2024-01-07 19:20:48 +00:00
- name: Prune GHCR containers
2024-01-07 19:15:56 +00:00
uses: vlaurin/action-ghcr-prune@v0.5.0
with:
2024-01-07 19:20:48 +00:00
token: ${{ secrets.TOKEN }}
organization: meikooy
container: ${{ inputs.container }}
keep-younger-than: ${{ inputs.older-than }}
keep-last: ${{ inputs.keep-last }}
2024-01-07 19:15:56 +00:00
prune-untagged: true