Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
fix prune workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
watzon committed Jan 7, 2024
1 parent 5b9e534 commit 4baa348
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/docker-prune.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
name: Prune Containers
name: Prune containers

on:
schedule:
- cron: '33 6 * * *' # 6:33 UTC every day
workflow_dispatch:

env:
package_name: paste69
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"

jobs:
build:
prune:
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Prune
- name: Prune GHCR containers
uses: vlaurin/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
organization: ${{ github.repository_owner }}
container: ${{ env.package_name }}
dry-run: true # Dry-run first, then change to `false`
keep-younger-than: 2 # days
keep-last: 2
token: ${{ secrets.TOKEN }}
organization: meikooy
container: ${{ inputs.container }}
keep-younger-than: ${{ inputs.older-than }}
keep-last: ${{ inputs.keep-last }}
prune-untagged: true

0 comments on commit 4baa348

Please sign in to comment.