forked from wrench-project/wrench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.publish
28 lines (19 loc) · 848 Bytes
/
.travis.publish
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
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Documentation Build and Deployment" ]]; then
echo "Starting to update gh-pages"
#copy data we're interested in to other place
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://${GITHUB_TOKEN}@github.com/wrench-project/wrench.git gh-pages > /dev/null
#go into directory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/gh-pages-to-deploy/* .
touch .nojekyll
#add, commit and push files
git add -f .
git diff-index --quiet HEAD || git commit -m "Travis build $TRAVIS_BUILD_NUMBER"
git push -fq origin gh-pages > /dev/null
echo "Done updating gh-pages."
fi;