-
Notifications
You must be signed in to change notification settings - Fork 13
/
cloudbuild.yaml
42 lines (37 loc) · 1.21 KB
/
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
33
34
35
36
37
38
39
40
41
42
steps:
# build the base image using Kaniko for caching
- name: 'gcr.io/kaniko-project/executor:latest'
waitFor: ['-']
id: DOCKER_BUILD
args:
- --destination=gcr.io/$PROJECT_ID/universal:$BUILD_ID
- --cache=true
# deploy the container to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- beta
- run
- deploy
- universal
- --image=gcr.io/$PROJECT_ID/universal:$BUILD_ID
- --region=us-central1
id: DEPLOY_CLOUD_RUN
waitFor: ['DOCKER_BUILD']
# deploy the Firebase application
- name: 'gcr.io/$PROJECT_ID/universal:$BUILD_ID'
dir: '/usr/src/app'
id: DEPLOY_FIREBASE
entrypoint: 'sh'
args:
- -c
- ./node_modules/.bin/firebase deploy --token $$FIREBASE_TOKEN --non-interactive
secretEnv: ['FIREBASE_TOKEN']
waitFor: ['DOCKER_BUILD']
# TODO Don't use token once fixed https://github.com/firebase/firebase-tools/issues/787
secrets:
- kmsKeyName: projects/onsnapshot/locations/global/keyRings/cloudbuild-ring/cryptoKeys/cloudbuild-key
secretEnv:
FIREBASE_TOKEN: CiQANB2PTWPbq51e04pCCFMfUT/K5rzni9Y9l8BouIMQy+h57d0SVwB0j9PfPkC7b8M67ffpuiU0HilpXr1TjuERtXIciRgvmvOCY8Yi8NjmW8835WZ3Q4b5IwfzdRky9F8KzqpszAz4gW94Rj7vSmTkln6rx+g2nNkXmPYyng==
images:
- gcr.io/$PROJECT_ID/universal
timeout: 1200s