Skip to content

Commit

Permalink
Merge pull request #5528 from leonardehrenfried/prune-container-images
Browse files Browse the repository at this point in the history
Remove container images that have not been pulled for over a year
  • Loading branch information
leonardehrenfried authored Dec 4, 2023
2 parents 7163a76 + 053f875 commit ebab594
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/prune-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Delete unused snapshot 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.3
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate

0 comments on commit ebab594

Please sign in to comment.