feat: cleanup old images on the 15th of the month.

This commit is contained in:
Robert Wlodarczyk 2023-06-25 19:07:53 -07:00
parent c7a835217c
commit c3a1963b9c

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

@ -0,0 +1,28 @@
---
name: cleanup
on:
schedule:
- cron: '0 0 15 * *'
env:
IMAGE_NAME: ${{ github.actor }}/docker-crontab
jobs:
cleanup-docker-crontab:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Delete Docker images older than a month.
uses: snok/container-retention-policy@v2
with:
account-type: personal
cut-off: One month ago UTC
keep-at-least: 4
skip-tags: latest
image-names: ${{ env.IMAGE_NAME }}
token: ${{ secrets.GHCR_TOKEN }}