-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
71 lines (67 loc) · 1.36 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
63
64
65
66
67
68
69
70
71
stages:
- setup
- test
- build
- deploy
install-dependencies:
image: node:$NODE_VERSION
stage: setup
before_script:
- npm -g config set user root
script:
- npm install --production
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
test:
image: node:$NODE_VERSION
stage: test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
before_script:
- npm run lint
script:
- npm run test-coverage
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
build:production:
image: node:$NODE_VERSION
stage: build
only:
- master
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
script:
- npm run build
after_script:
- gzip -k build/*js
- gzip -k build/*txt
- gzip -k build/*html
- gzip -k build/*ico
- gzip -k build/*json
- gzip -k build/static/media/*woff
- gzip -k build/static/css/*css
- gzip -k build/static/js/*js
artifacts:
paths:
- /builds/wynstonramsay/website/build
deploy:production:
image: node:$NODE_VERSION
stage: deploy
only:
- master
environment:
name: Production
url: https://wynstonramsay.ca
dependencies:
- build:production
before_script:
- npm i -g firebase-tools
script:
- firebase deploy --token $FIREBASE_TOKEN -m "$CI_COMMIT_MESSAGE"
when: manual
allow_failure: false