-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloud-build.yaml
81 lines (81 loc) · 2.22 KB
/
cloud-build.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
docker pull gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website:latest || exit 0
- name: gcr.io/cloud-builders/docker
timeout: 1200s
args:
[
'build',
'-f',
'Dockerfile',
'-t',
'gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website',
'--cache-from',
'gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website:latest',
'.',
'--build-arg',
'NODE_ENV=${_NODE_ENV}',
'--build-arg',
'NEXT_PUBLIC_FB_PROJECT_ID=${_NEXT_PUBLIC_FB_PROJECT_ID}',
'--build-arg',
'NEXT_PUBLIC_FB_API_KEY=${_NEXT_PUBLIC_FB_API_KEY}',
'--build-arg',
'NEXT_PUBLIC_FB_MESSAGING_SENDER_ID=${_NEXT_PUBLIC_FB_MESSAGING_SENDER_ID}',
'--build-arg',
'NEXT_PUBLIC_FB_APP_ID=${_NEXT_PUBLIC_FB_APP_ID}',
'--build-arg',
'NEXT_PUBLIC_FB_MEASUREMENT_ID=${_NEXT_PUBLIC_FB_MEASUREMENT_ID}',
'--build-arg',
'NEXT_PUBLIC_AL_APP_ID=${_NEXT_PUBLIC_AL_APP_ID}',
'--build-arg',
'NEXT_PUBLIC_AL_ADMIN_KEY=${_NEXT_PUBLIC_AL_ADMIN_KEY}',
'--build-arg',
'NEXT_PUBLIC_AL_SEARCH_KEY=${_NEXT_PUBLIC_AL_SEARCH_KEY}',
'--build-arg',
'NEXT_PUBLIC_GM_API_KEY=${_NEXT_PUBLIC_GM_API_KEY}',
'--build-arg',
'NEXT_PUBLIC_GC_GRADE=${_NEXT_PUBLIC_GC_GRADE}',
]
- name: 'gcr.io/cloud-builders/docker'
args:
[
'push',
'gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website',
]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
[
'run',
'deploy',
'website',
'--image',
'gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website',
'--region',
'us-east1',
'--platform',
'managed',
'--port',
'3000',
]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
[
'run',
'services',
'update-traffic',
'website',
'--to-latest',
'--platform',
'managed',
'--region',
'us-east1',
]
timeout: 1200s
images:
- gcr.io/${_NEXT_PUBLIC_FB_PROJECT_ID}/website