-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
49 lines (44 loc) · 1.24 KB
/
cloudbuild.yaml
File metadata and controls
49 lines (44 loc) · 1.24 KB
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
steps:
# ===== get cached build dependencies =====
- name: "gcr.io/cloud-builders/gsutil"
id: "get-cache"
entrypoint: "sh"
args:
- -c
- |
gsutil -m cp gs://dependency-cache/$REPO_NAME-$(sha256sum package-lock.json | cut -c1-10).tar /tmp/ || exit 0 \
&& tar -xf /tmp/$REPO_NAME-$(sha256sum package-lock.json | cut -c1-10).tar --directory ~/ || exit 0
- name: "cypress/base:10"
id: "install-deps"
entrypoint: "sh"
args:
- -c
- |
npm ci
- name: "gcr.io/cloud-builders/gsutil"
id: "save-cache"
entrypoint: "sh"
args:
- -c
- |
tar -C ~/ -cf $REPO_NAME-$(sha256sum package-lock.json | cut -c1-10).tar .cache \
&& gsutil -m cp $REPO_NAME-$(sha256sum package-lock.json | cut -c1-10).tar gs://dependency-cache/$REPO_NAME-$(sha256sum package-lock.json | cut -c1-10).tar
- name: "cypress/base:10"
id: "build"
waitFor: ["install-deps"]
entrypoint: "sh"
args:
- -c
- |
npm run build
- name: "gcr.io/cloud-builders/gsutil"
id: "deploy"
waitFor: ["save-cache", "build"]
entrypoint: "sh"
args:
- -c
- |
if [ $BRANCH_NAME = master ]; then
sh deploy.sh
fi;
timeout: "600s"