-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
59 lines (59 loc) · 1.22 KB
/
.travis.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
sudo: true
branches:
only:
- master
- dev
language: node_js
node_js:
- node
cache:
directories:
- "$HOME/website/build/"
before_install:
- cd functions
- echo $SERVICE_ACCOUNT_KEY | gpg --passphrase-fd 0 service-account.tar.gpg
- tar xvf service-account.tar
- cd ..
jobs:
include:
- stage: Unit tests
name: Unit Tests Functions
before_script:
- cd functions
- npm i
script: npm run test:coverage
- stage: Unit tests
name: Unit Tests Website
before_script:
- cd website
- npm i
script: npm run test
- stage: Build
if: branch = dev
name: Build Dev Website
before_script:
- cd website
- npm i
script:
- npm run build-dev
- cp -R build/. $HOME/website/build/
- stage: Build
if: branch = master
name: Build Prod Website
before_script:
- cd website
- npm i
script:
- npm run build-prod
- cp -R build/. $HOME/website/build/
- stage: Deploy
name: Deploy
before_script:
- cp -R $HOME/website/build/. public/
- npm install firebase-tools -g
- cd functions
- npm i
- cd ..
script:
- firebase use --token $FIREBASE_TOKEN $FIREBASE_PROJECT_ID
- firebase deploy --token $FIREBASE_TOKEN