Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (21 sloc) 824 Bytes
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R /tmp $HOME/spec
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/rafaelfiume/tictactoe.git gh-pages > /dev/null
#go into directory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/spec/index.html index.html
cp -Rf $HOME/spec/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages > /dev/null
echo -e "Done copying the spec\n"
fi