Skip to content

Commit 3813f45

Browse files
author
Daniel Schmidt
committed
add publish script
1 parent 1cd3bd1 commit 3813f45

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ matrix:
1111
- yarn test
1212
after_script:
1313
- 'cat coverage/lcov.info | ./node_modules/.bin/coveralls'
14-
1514
# E2E Web
1615
- services:
1716
- docker
@@ -37,9 +36,5 @@ matrix:
3736
- NAME='Website'
3837
node_js: 8
3938
script:
40-
- git config --global user.email "$GIT_USER@users.noreply.github.com"
41-
- git config --global user.name "Daniel Schmidt"
42-
- echo "machine github.com login $GIT_USER password $GITHUB_TOKEN" > ~/.netrc
43-
- npm install
44-
- cd website && npm install && GIT_USER=$GIT_USER npm run publish-gh-pages
39+
- scripts/publish-website.sh
4540

scripts/publish-website.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -e
2+
3+
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
4+
git config user.email "$GIT_USER@users.noreply.github.com"
5+
git config user.name "$GIT_USER"
6+
echo "machine github.com login $GIT_USER password $GIT_TOKEN" > ~/.netrc
7+
8+
cd website
9+
npm install
10+
GIT_USER=$GIT_USER CURRENT_BRANCH=master npm run publish-gh-pages
11+
else
12+
echo 'Not deploying the website'
13+
exit 0;
14+
fi
15+

0 commit comments

Comments
 (0)