gcr-cleaner #751
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]" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
gcr-cleaner: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- id: "auth" | |
name: "Authenticate to GCP" | |
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 | |
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 |