Skip to content

Cleanup untagged containers #148

Cleanup untagged containers

Cleanup untagged containers #148

name: Cleanup untagged containers
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
jobs:
organization_containers:
name: Get all containers in the organization
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.organization_containers.outputs.packages }}
steps:
- name: Organization containers
id: organization_containers
uses: tue-robotics/tue-env/ci/organization-packages@master
with:
package-type: container
token: ${{ secrets.READ_PACKAGES_TOKEN }}
delete_untagged_containers:
name: Delete untagged containers
runs-on: ubuntu-latest
needs: organization_containers
strategy:
fail-fast: false
matrix:
package_name: ${{ fromJson(needs.organization_containers.outputs.packages) }}
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ matrix.package_name }}
package-type: container
delete-only-untagged-versions: true
min-versions-to-keep: 0