Last active
February 7, 2016 21:07
-
-
Save glenjamin/6035d383af18ce27046a to your computer and use it in GitHub Desktop.
Script that automatically rebuilds a github pages branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# !!!! | |
echo "*** REPLACE this with the line which builds docs" | |
# !!!! | |
echo "*** Docs built ***" | |
tmpdir=`mktemp -d /tmp/gh-pages-build.XXXXXX` | |
mv doc/** $tmpdir | |
rmdir doc | |
git checkout gh-pages | |
git rm -rf . | |
mv $tmpdir/** . | |
git add -Av . | |
git commit -m "Updated docs" | |
echo "*** gh-pages branch updated ***" | |
rmdir $tmpdir | |
git checkout - | |
echo "Run this to complete:" | |
echo "git push origin gh-pages:gh-pages" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://gist.github.com/domenic/ec8b0fc8ab45f39403dd