Skip to content

Commit

Permalink
Only publish the website on master
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Feb 6, 2018
1 parent 49f97de commit f3b7694
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ matrix:
- NAME='Website - master'
node_js: 8
script:
- git config --global user.email "$GIT_USER@users.noreply.github.com"
- git config --global user.name "Wix"
- echo "machine github.com login $GIT_USER password $GIT_TOKEN" > ~/.netrc
- cd website && npm install && GIT_USER=$GIT_USER CURRENT_BRANCH=master npm run publish-gh-pages
branches:
only:
- master
- scripts/publish-website.sh

branches:
only:
Expand Down
16 changes: 16 additions & 0 deletions scripts/publish-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" != "master" ]]; then
echo 'Not deploying the website';
exit 0;
else
git config --global user.email "$GIT_USER@users.noreply.github.com";
git config --global user.name "Wix";
echo "machine github.com login $GIT_USER password $GIT_TOKEN" > ~/.netrc;
cd website;
npm install;
GIT_USER=$GIT_USER CURRENT_BRANCH=master npm run publish-gh-pages;
fi

0 comments on commit f3b7694

Please sign in to comment.