Retention Policy #115
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: Retention Policy | |
on: | |
schedule: | |
# every day at 00:05 UTC | |
- cron: '5 0 * * *' | |
workflow_dispatch: # And manually on button click | |
jobs: | |
clean: | |
runs-on: ubuntu-latest | |
steps: | |
# Delete all untagged container versions except last 12 | |
# https://github.com/actions/delete-package-versions | |
- name: Delete all untagged Docker images | |
uses: actions/delete-package-versions@v5 | |
id: delete | |
with: | |
package-name: ${{ github.event.repository.name }} | |
package-type: 'container' | |
min-versions-to-keep: 12 | |
delete-only-untagged-versions: 'true' | |
token: ${{ secrets.GITHUB_TOKEN }} |