forked from ONEARMY/community-platform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
33 lines (31 loc) · 858 Bytes
/
.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
language: node_js
node_js:
- '8'
dist: trusty
sudo: false
cache: yarn
addons:
chrome: stable
# add the current github branch as an environment variable
before_script:
- export REACT_APP_BRANCH=$TRAVIS_BRANCH
- echo "REACT_APP_BRANCH=$REACT_APP_BRANCH"
script:
- npm run build
# install firebase cli and set firebase project ci token from environment
before_deploy:
- npm install -g firebase-tools
- export FIREBASE_TOKEN=$(if [ "$TRAVIS_BRANCH" == "production" ]; then echo "$FIREBASE_PRODUCTION_TOKEN"; else echo "$FIREBASE_STAGING_TOKEN"; fi)
deploy:
- provider: script
script: bash scripts/deploy.dev.sh
skip_cleanup: true
on:
branch: master
- provider: script
script: bash scripts/deploy.prod.sh
skip_cleanup: true
on:
branch: production
after_deploy:
- echo "REACT_APP_BRANCH=$REACT_APP_BRANCH"