gcr-cleaner #388
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 | |
env: | |
GCP_WORKLOAD_IDENTITY_PROVIDER: 'projects/765091727073/locations/global/workloadIdentityPools/hato-atama-workload-identity/providers/github' | |
GCP_SERVICE_ACCOUNT: '[email protected]' | |
jobs: | |
gcr-cleaner: | |
runs-on: 'ubuntu-latest' | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/[email protected] | |
- id: 'auth' | |
name: 'Authenticate to GCP' | |
uses: google-github-actions/[email protected] | |
with: | |
workload_identity_provider: ${{env.GCP_WORKLOAD_IDENTITY_PROVIDER}} | |
service_account: ${{env.GCP_SERVICE_ACCOUNT}} | |
# customize based on the gcr-cleaner flags | |
- uses: docker://us-docker.pkg.dev/gcr-cleaner/gcr-cleaner/gcr-cleaner-cli:0.10.0 | |
with: | |
args: >- | |
-repo=asia-docker.pkg.dev/hato-atama/asia.gcr.io -grace=48h -tag-filter-any ".*" -recursive=true |