Created
September 27, 2014 23:45
-
-
Save lukespragg/ff7fd9492aeb0c57e7d4 to your computer and use it in GitHub Desktop.
Basic script for updating GitHub pages from Travis-CI.
This file contains hidden or 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
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then | |
echo -e "Changing directory to $HOME and configuring git" | |
cd $HOME | |
git config --global user.email "[email protected]" | |
git config --global user.name "Travis" | |
echo -e "Cloning gh-pages repo using token" | |
git clone --quiet --branch=gh-pages https://[email protected]/$TRAVIS_REPO_SLUG.git gh-pages > /dev/null | |
echo -e "Copy apidocs to gh-pages repo root" | |
cd gh-pages | |
cp -Rf $HOME/build/$TRAVIS_REPO_SLUG/target/site/apidocs/* . | |
echo -e "Adding, committing, and pushing apidocs to gh-pages repo" | |
git add -f . | |
git commit -m "Update JavaDocs for Travis build $TRAVIS_BUILD_NUMBER" | |
git push -q origin gh-pages > /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment