gcr-cleaner #229
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
# .github/workflows/gcr-cleaner.yml | |
name: 'gcr-cleaner' | |
on: | |
schedule: | |
- cron: '0 0 */1 * *' # runs daily | |
workflow_dispatch: # allows for manual invocation | |
jobs: | |
gcr-cleaner: | |
runs-on: 'ubuntu-latest' | |
steps: | |
# configure based on your registry | |
- name: Login to GAR | |
uses: 'docker/login-action@v2' | |
with: | |
registry: us-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
# delete untaggd images older than 48 hours | |
- uses: 'docker://us-docker.pkg.dev/gcr-cleaner/gcr-cleaner/gcr-cleaner-cli' | |
with: | |
args: >- | |
-repo=us-docker.pkg.dev/spinnaker-community/docker | |
-grace=48h | |
-dry-run=true |