summaryrefslogtreecommitdiff
path: root/docs/update_ghpages.sh
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
committerMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
commitcce638a8adf4e045ca5505afea4bda57753c31dd (patch)
treeb5e139d3359ac5b8c7b1afa8acbb1b5b6051c626 /docs/update_ghpages.sh
initial import of debian package
Diffstat (limited to 'docs/update_ghpages.sh')
-rwxr-xr-xdocs/update_ghpages.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/update_ghpages.sh b/docs/update_ghpages.sh
new file mode 100755
index 0000000..a097691
--- /dev/null
+++ b/docs/update_ghpages.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env sh
+# pick repo for gh-pages branch
+repo=origin
+
+if [ ! -d gh-pages ]; then
+ echo "setting up gh-pages subdir"
+ mkdir gh-pages || exit -1
+ cp -r ../.git gh-pages/ || exit -1
+ cd gh-pages || exit -1
+ init=0
+ git checkout $repo/gh-pages || init=1
+ if [ "$init" != "0" ]; then
+ echo "initializing gh-pages repo"
+ git symbolic-ref HEAD refs/heads/gh-pages || exit -1
+ rm .git/index || exit -1
+ git clean -fdx || exit -1
+ touch index.html
+ git add .
+ git commit -a -m 'init gh-pages' || exit -1
+ git push origin HEAD:gh-pages
+ fi
+ cd ..
+fi
+echo "updating local gh-pages with html build"
+rsync -va build/html/ gh-pages/ --delete --exclude .git --exclude .nojekyll || exit -1
+cd gh-pages
+touch .nojekyll
+git add .nojekyll
+git add .
+git commit -a || exit -1
+echo "pushing to remote gh-pages"
+# pwd
+git push $repo HEAD:gh-pages