-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
62 lines (54 loc) · 1.03 KB
/
.gitlab-ci.yml
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
image: node:8
stages:
- build
- test
- deploy
before_script:
- mkdir secret
- yarn config set cache-folder .yarn-cache
- yarn
- cd functions && yarn && cd ..
after_script:
- rm -rf secret
cache:
untracked: true
key: "NODE_8-$CI_PROJECT_ID"
paths:
- .yarn-cache
variables:
BUILD_ID: $CI_COMMIT_SHA
build:
stage: build
environment:
name: $CI_COMMIT_REF_SLUG
url: $ORIGIN
artifacts:
paths:
- dist/
- functions/index.js
only:
- next
- master
script:
# Build config/secrets
- echo $ORIGIN > secret/origin.txt
- echo $GOOGLEAPI_CLIENT_CREDENTIALS > secret/client.json
- echo $FIREBASE_CONFIG > secret/firebase-config.json
# build
- yarn build
- cd functions && yarn build && cd ..
test-functions:
stage: test
script:
- cd functions && yarn test && cd ..
deploy:
stage: deploy
environment:
name: $CI_COMMIT_REF_SLUG
url: $ORIGIN
only:
- next
- master
script:
- yarn firebase --version
- yarn deploy-all --project $CI_ENVIRONMENT_SLUG --token $FIREBASE_CI_TOKEN