Skip to content

gcr-cleaner

gcr-cleaner #761

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@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