Add action to clean up untagged (non-multiarch) images from GHCR

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2023-09-21 01:13:11 +01:00
parent 99c2344b77
commit 3f122308fc
No known key found for this signature in database
1 changed files with 28 additions and 0 deletions

28
.github/workflows/housekeeping.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: housekeeping
on:
workflow_dispatch:
jobs:
housekeeping:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry with PAT_TOKEN
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_TOKEN }}
-
name: Delete all containers from repository without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
untagged_only: true
owner_type: org # or user
except_untagged_multiplatform: true