Cleanup untagged containers #50
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: 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 |