-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
48 lines (43 loc) · 1.25 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
image: node:latest
stages:
- build
- test
- deploy
#- code_quality # need to create, @Kam, npm test - --with-coverage? for Jest+Enzyme or whatever the flags are
cache: &global_cache
paths:
- node_modules/
policy: pull-push
build:
stage: build #HERE1
script:
- yarn add typescript
- yarn # builds our dependencies (node_modules from package.json and package-lock.json)
artifacts:
paths:
- public
only:
refs:
- merge_requests
- master
deploy:
stage: deploy
# For netlify we must specify the envrironment and its name/url which can be obtianed from site-settings in Netlify
environment:
name: production
url: https://shadow-run.netlify.app
only:
- master
script:
- npm i -g netlify-cli # here we install a global CLI (command line interface) via npm so that we can deploy to Netlify
- yarn run build # builds the ts bundle
- npx netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod
test:
stage: test
cache:
<<: *global_cache
policy: pull
script:
- yarn add typescript
- CI=true; yarn test -u # here the CI=true flag is needed so that npm test does not wait for user input (prompts) and just runs the tests
coverage: /All files\s*\|\s*([\d\.]+)/