2010-01-05 00:32:20 +03:00
|
|
|
#!/bin/zsh
|
|
|
|
|
|
|
|
# Should be run from the docs directory: (cd docs && ./build-github.zsh)
|
|
|
|
|
|
|
|
REPO=$(dirname $(pwd))
|
2010-01-14 04:01:10 +03:00
|
|
|
GH=_gh-pages
|
2010-01-05 00:32:20 +03:00
|
|
|
|
2010-01-15 02:56:59 +03:00
|
|
|
# Update our local gh-pages branch
|
|
|
|
git checkout gh-pages && git pull && git checkout -
|
|
|
|
|
2010-01-05 00:32:20 +03:00
|
|
|
|
|
|
|
# Checkout the gh-pages branch, if necessary.
|
|
|
|
if [[ ! -d $GH ]]; then
|
|
|
|
git clone $REPO $GH
|
2010-02-03 08:47:17 +03:00
|
|
|
pushd $GH
|
2010-01-05 00:32:20 +03:00
|
|
|
git checkout -b gh-pages origin/gh-pages
|
2010-02-03 08:47:17 +03:00
|
|
|
popd
|
2010-01-05 00:32:20 +03:00
|
|
|
fi
|
|
|
|
|
2010-02-03 08:47:17 +03:00
|
|
|
# Update and clean out the _gh-pages target dir.
|
|
|
|
pushd $GH && git pull && rm -rf * && popd
|
2010-01-23 04:54:51 +03:00
|
|
|
|
2010-01-05 00:32:20 +03:00
|
|
|
# Make a clean build.
|
|
|
|
make clean dirhtml
|
|
|
|
|
|
|
|
# Move the fresh build over.
|
|
|
|
cp -r _build/dirhtml/* $GH
|
|
|
|
cd $GH
|
|
|
|
|
|
|
|
# Commit.
|
|
|
|
git add .
|
|
|
|
git commit -am "gh-pages build on $(date)"
|
|
|
|
git push origin gh-pages
|