Skip to content

gcr-cleaner

gcr-cleaner #1165

Workflow file for this run

# .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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- id: "auth"
name: "Authenticate to GCP"
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
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@sha256:e87833a3f545324338856c21ad1ea18eca0be3ec3446ec1af8939a90dc427138
with:
args: >-
-repo=asia-docker.pkg.dev/hato-atama/asia.gcr.io -grace=48h -tag-filter-any ".*" -recursive=true