Scheduled: Cleanup #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Scheduled: Cleanup" | |
on: | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
description: Run in dry-mode | |
default: true | |
packages: | |
type: string | |
description: Packages to cleanup | |
default: "*" | |
delete-untagged: | |
type: boolean | |
description: Delete untagged images | |
default: true | |
delete-orphaned: | |
type: boolean | |
description: Delete orphaned images | |
default: true | |
# schedule: | |
# - cron: "0 4 * * 1" | |
permissions: | |
packages: write | |
jobs: | |
cleanup: | |
name: Cleanup untagged images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/#-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Delete all containers from GHCR without tags | |
uses: dataaxiom/ghcr-cleanup-action@v1 | |
with: | |
token: ${{ secrets.GHCR_TOKEN }} | |
dry-run: ${{ inputs.dry-run }} | |
owner: bjw-s-labs | |
packages: ${{ inputs.packages }} | |
expand-packages: true | |
delete-untagged: ${{ inputs.delete-untagged }} | |
delete-orphaned-images: ${{ inputs.delete-orphaned }} | |
validate: true |