-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
32 lines (32 loc) · 985 Bytes
/
cloudbuild.yaml
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
29
30
31
32
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker build -t gcr.io/$PROJECT_ID/website:$COMMIT_SHA . --build-arg ADMINS="$$ADMINS" --no-cache' ]
secretEnv: ['ADMINS']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/website:$COMMIT_SHA']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'beta'
- 'run'
- 'deploy'
- 'website'
- '--image'
- 'gcr.io/$PROJECT_ID/website:$COMMIT_SHA'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
- '--set-secrets'
- 'DATABASE_URL=newsroomDBUrl:latest,ROCKET_DATABASES=ROCKET_DATABASES:latest'
images:
- 'gcr.io/$PROJECT_ID/website:$COMMIT_SHA'
timeout: 1200s
availableSecrets:
secretManager:
- versionName: projects/904165140417/secrets/ADMINS/versions/2
env: 'ADMINS'