Skip to content

Commit

Permalink
publish to gh-pages only for master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbbottam committed Aug 9, 2015
1 parent 1819d7c commit 983fb39
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions script/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/bin/sh

rm -rf dist || exit 0;
mkdir dist;
( cd dist
git init
git config user.name "sarbbottam"
git config user.email "sarbbottam@gmail.com"
cp ../example/index.html ./index.html
cp ../example/main.css ./main.css
cp ../example/main.js ./main.js
git add .
git commit -m "initial commit"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
)
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mkdir dist;
( cd dist
git init
git config user.name "sarbbottam"
git config user.email "sarbbottam@gmail.com"
cp ../example/index.html ./index.html
cp ../example/main.css ./main.css
cp ../example/main.js ./main.js
git add .
git commit -m "initial commit"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
)
else
echo "not publising to gh-pages"
fi

0 comments on commit 983fb39

Please sign in to comment.