-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
54 lines (48 loc) · 1.04 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
image: node:10
cache:
paths:
- node_modules/
install:
stage: build
script:
- yarn install --frozen-lockfile
lint:
stage: test
script:
- yarn lint
rules:
- if: '$CI_JOB_TRIGGERED != "true"'
when: always
audit:
stage: test
script:
- yarn audit
rules:
- if: '$CI_JOB_TRIGGERED != "true"'
when: always
allow_failure: true
# Build and deploy to GitHub pages.
ghpages:deploy:
stage: deploy
script:
- bash script/build.sh
- bash script/deploy.sh
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
when: always
# Build and deploy to GitLab pages.
pages:
stage: deploy
script:
# dynamically generate the PUBLIC_PATH from
# the Gitlab CI environment variable.
- export PUBLIC_PATH=$(echo "$CI_PAGES_URL" | sed -E 's#^(http|https)://([[:alnum:]\.\-\_]+?)(/.+)$#\3#g')
- bash script/build.sh
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
when: always
- if: '$CI_COMMIT_REF_NAME == "staging"'
when: always