-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.travis.yml
49 lines (38 loc) · 1.68 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
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
cache:
directories:
- $TRAVIS_BUILD_DIR/tmp/.htmlproofer #https://github.com/gjtorikian/html-proofer/issues/381
language:
- node_js
- ruby
node_js:
- 6.9
rvm:
- 2.7.2
before_install:
- rvm install 2.7.2
- gem install bundler
- npm install -g yarn netlify-cli
install:
- bundle install
- yarn
addons:
apt:
packages:
- libcurl4-openssl-dev
script:
- npm run build
# Previous folders are HUGE. Remove them before deploying.
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then rm -rf ./_site/2017 ./_site/2016 ./_site/2015; fi
# Deploy a PR Preview
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export RESULT=$(netlify deploy -t $NETLIFY_ACCESS_TOKEN -s devitconf -p _site/ | grep -Eo 'http://[^ >]+'|head -1); fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then curl -H "Authorization:token $GITHUB_COMMENT" -X POST -d "{\"body\":\"View your PR here $RESULT.\"}" "https://api.github.com/repos/skgtech/devit/issues/$TRAVIS_PULL_REQUEST/comments"; fi
# @See: See package.json scripts
- npm run lint
# Deploy on Production
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git config --global user.email [email protected] && git config --global user.name "Travis"; fi
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git remote remove origin; fi
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git remote add origin https://${GITHUB_COMMENT}@github.com/skgtech/devit.git > /dev/null 2>&1; fi
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run deploy; fi