Skip to content

Commit

Permalink
Added build-github script from Zamboni to push docs to gh-pages autom…
Browse files Browse the repository at this point in the history
…agically.
  • Loading branch information
Fred Wenzel committed Jan 20, 2011
1 parent caf520b commit 4438eb2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
30 changes: 30 additions & 0 deletions build-github.zsh
@@ -0,0 +1,30 @@
#!/bin/zsh

# Should be run from the docs directory: (cd docs && ./build-github.zsh)

REPO=$(dirname $(pwd))
GH=_gh-pages


# Checkout the gh-pages branch, if necessary.
if [[ ! -d $GH ]]; then
git clone $REPO $GH
pushd $GH
git checkout -b gh-pages origin/gh-pages
popd
fi

# Update and clean out the _gh-pages target dir.
pushd $GH && git pull && rm -rf * && popd

# 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
10 changes: 9 additions & 1 deletion docs.rst
Expand Up @@ -70,4 +70,12 @@ Here's a nice macro for creating headings::
Compiling Documentation
-----------------------

Playdoh hosts its documentation on github pages.
Playdoh hosts its documentation on `github pages
<http://mozilla.github.com/playdoh/>`_. When you change the docs, make sure
they still build properly and look all right locally::

cd docs && make html && open _build/html/index.html

If they do, run a build and push it to gh-pages::

./build-github.zsh

0 comments on commit 4438eb2

Please sign in to comment.