Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website build only run on master #544

Merged
merged 1 commit into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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