-
Notifications
You must be signed in to change notification settings - Fork 3
28 lines (28 loc) · 1.04 KB
/
gcr-cleaner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# .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/[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