-
Notifications
You must be signed in to change notification settings - Fork 193
/
update-gh-pages.sh
executable file
·30 lines (22 loc) · 916 Bytes
/
update-gh-pages.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# copied from http://sleepycoders.blogspot.ie/2013/03/sharing-travis-ci-generated-files.html
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
doxygen Doxyfile
#copy data we're interested in to other place
cp -R html $HOME/html
#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/wheybags/freeablo.git gh-pages > /dev/null
# clear old files
find . -depth 1 ! -iname ".git" -exec rm -rf {} \;
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/html/* .
#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
fi