Skip to content

Prune container images #9

Prune container images

Prune container images #9

name: 'Prune container images'
on:
schedule:
- cron: '0 12 * * 1'
workflow_dispatch:
jobs:
container-image:
if: github.repository_owner == 'opentripplanner'
runs-on: ubuntu-latest
steps:
- name: Delete unused container images
env:
CONTAINER_REPO: opentripplanner/opentripplanner
CONTAINER_REGISTRY_USER: otpbot
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
# remove all snapshot container images that have not been pulled for over a year
# --keep-semver makes sure that any image with a x.y.z version scheme is unaffected by this
pip install prune-container-repo==0.0.4
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate