diff --git a/.travis.yml b/.travis.yml index 9b96899dbd..e98355e613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/scripts/publish-website.sh b/scripts/publish-website.sh new file mode 100755 index 0000000000..8cc983ffea --- /dev/null +++ b/scripts/publish-website.sh @@ -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