This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jpsc
committed
Jul 18, 2016
1 parent
bea7081
commit 524671f
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -e # exit with nonzero exit code if anything fails | ||
|
||
if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
|
||
echo "Starting to update gh-pages\n" | ||
|
||
#copy data we're interested in to other place | ||
cp -R dist $HOME/dist | ||
|
||
#go to home and setup git | ||
cd $HOME | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis" | ||
|
||
#using token clone gh-pages branch | ||
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/${GH_USER}/${GH_REPO}.git gh-pages > /dev/null | ||
|
||
#go into directory and copy data we're interested in to that directory | ||
cd gh-pages | ||
cp -Rf $HOME/dist/* . | ||
|
||
echo "Allow files with underscore https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/" > .nojekyll | ||
echo "[View live](https://${GH_USER}.github.io/${GH_REPO}/)" > README.md | ||
|
||
#add, commit and push files | ||
git add -f . | ||
git commit -m "Travis build $TRAVIS_BUILD_NUMBER" | ||
git push -fq origin gh-pages > /dev/null | ||
|
||
echo "Done updating gh-pages\n" | ||
|
||
else | ||
echo "Skipped updating gh-pages, because build is not triggered from the master branch." | ||
fi; |