-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcloudbuild.yaml
78 lines (71 loc) · 2.14 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
steps:
- name: 'gcr.io/$PROJECT_ID/restore_cache'
id: restore_cache
waitFor: ['-']
script: |
#!/usr/bin/env bash
restore_cache \
--bucket=gs://frontend-cache-dependencies \
--key=node_modules-$( checksum yarn.lock )
restore_cache \
--bucket=gs://frontend-cache-dependencies \
--key=yarn-$( checksum yarn.lock )
restore_cache \
--bucket=gs://frontend-cache-dependencies \
--key=yarn-install-state-$( checksum yarn.lock )
- id: 'install-yarn'
waitFor: ['restore_cache']
name: node:21
script: |
yarn set version 4.6.0
yarn -v
yarn install --immutable
- id: 'save_cache'
waitFor: ['install-yarn']
name: 'gcr.io/$PROJECT_ID/restore_cache'
script: |
#!/usr/bin/env bash
save_cache \
--bucket=gs://frontend-cache-dependencies \
--key=node_modules-$( checksum yarn.lock ) \
--path=./node_modules \
--no-clobber
save_cache \
--bucket=gs://frontend-cache-dependencies \
--key=yarn-$( checksum yarn.lock ) \
--path=.yarn/cache \
--no-clobber
save_cache \
--bucket=gs://frontend-cache-dependencies \
--key=yarn-install-state-$( checksum yarn.lock ) \
--path=.yarn/install-state.gz \
--no-clobber
- id: 'setup auth to npmjs'
waitFor: ['install-yarn']
name: node:21
args:
- '-c'
- |
echo "//registry.npmjs.org/:_authToken=$$NODE_AUTH_TOKEN" > .npmrc
entrypoint: bash
secretEnv:
- NODE_AUTH_TOKEN
- id: 'i18n-labels publish stable'
waitFor: ['setup auth to npmjs']
name: node:21
env:
- 'NX_CLOUD_AUTH_TOKEN=$_NX_CLOUD_AUTH_TOKEN'
entrypoint: npx
args: ['nx', 'publish:stable', 'i18n-labels']
- id: 'i18n-labels purge stable'
waitFor: ['i18n-labels publish stable']
name: node:21
env:
- 'NX_CLOUD_AUTH_TOKEN=$_NX_CLOUD_AUTH_TOKEN'
entrypoint: npx
args: ['nx', 'purge:stable', 'i18n-labels']
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/NPM_TOKEN/versions/latest
env: NODE_AUTH_TOKEN
timeout: 1800s