Skip to content

Workflow file for this run

name: Cleanup Old Images
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
branches: [ master, ci-build-image ]
schedule:
# Build the image regularly (each Friday) to get new security fixes, even if pushes don't occur
- cron: '13 23 * * 5'
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
cleanup-old-images:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
steps:
- uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
package-type: 'container'
min-versions-to-keep: 2