-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild.yaml
56 lines (51 loc) · 1.73 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
steps:
- name: 'node:14.17.6'
id: 'build assets'
env:
- 'CI=true'
- 'COMMIT_SHA=${COMMIT_SHA}'
- 'SITE_URL=${_SITE_URL}'
- 'SHAPESHIFT_API_KEY=${_SHAPESHIFT_API_KEY}'
- 'SHAPESHIFT_CLIENT_ID=${_SHAPESHIFT_CLIENT_ID}'
- 'NODE_ENV=${_NODE_ENV}'
- 'MOONPAY_API_KEY=${_MOONPAY_API_KEY}'
- 'MOONPAY_WIDGET_BUY_URL=${_MOONPAY_WIDGET_BUY_URL}'
- 'MOONPAY_WIDGET_SELL_URL=${_MOONPAY_WIDGET_SELL_URL}'
- 'SENTRY_ENVIRONMENT=${_SENTRY_ENVIRONMENT}'
- 'SENTRY_DSN=${_SENTRY_DSN}'
- 'SENTRY_ORG=${_SENTRY_ORG}'
- 'SENTRY_AUTH_TOKEN=${_SENTRY_AUTH_TOKEN}'
- 'CHANGELLY_REF=${_CHANGELLY_REF}'
entrypoint: 'sh'
args:
- '-c'
- |
npm config set @coinspace:registry https://npm.pkg.github.com && \
npm config set "//npm.pkg.github.com/:_authToken" ${_NPM_READ_TOKEN} && \
NODE_ENV=CI npm ci && \
./cli/i18n.js --json && \
./cli/build.js web --env=${_BUILD_ENV} --release --platform=${_DISTRIBUTION}
- name: 'gcr.io/cloud-builders/docker'
id: 'build image'
entrypoint: 'sh'
args:
- '-c'
- |
docker build --build-arg NODE_AUTH_TOKEN=${_NPM_READ_TOKEN} --tag "gcr.io/$PROJECT_ID/${_APP}:latest" . \
&& docker push "gcr.io/$PROJECT_ID/${_APP}:latest"
- name: 'gcr.io/cloud-builders/kubectl'
id: 'deploy'
args: ['delete', 'po', '-l', 'app=${_APP}']
env:
- 'CLOUDSDK_COMPUTE_ZONE=${_CLOUDSDK_COMPUTE_ZONE}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_CLOUDSDK_CONTAINER_CLUSTER}'
- name: 'gcr.io/cloud-builders/gcloud'
id: 'purge cdn'
entrypoint: 'bash'
args:
- '-c'
- |
if [[ "${_DISTRIBUTION}" == "web" ]]; then
gcloud compute url-maps invalidate-cdn-cache ${_CDN_URL_MAP_NAME} --host ${_CDN_HOST} --path "/*" --async
fi
timeout: 900s