Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/container-cleanup-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Docker: Delete all containers from package without tags'

on:
schedule:
- cron: '44 4 * * *'

jobs:
build:
name: Delete all containers from package without tags
runs-on: "ubuntu-latest"
steps:

- name: Check github repository owner type
run: |
if [ "${{ github.repository_owner }}" = 'processone' ]
then echo "OWNER_TYPE=org" >> $GITHUB_ENV
else echo "OWNER_TYPE=user" >> $GITHUB_ENV
fi

- 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 package without tags
# uses: Chizkiyahu/delete-untagged-ghcr-action@v2
## This is a patched version from the action, which identifies manifests
## created with 'buildkit' correctly. PR should be merged soon.
uses: quartx-analytics/ghcr-cleaner@registry_api
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
package_name: eturnal
untagged_only: true
owner_type: ${{ env.OWNER_TYPE }}
except_untagged_multiplatform: true