Last Updated: February 25, 2016
·
1.31K
· optikfluffel

Automatic documentation update with ex_doc and Github pages for Elixir

After setting up your gh-pages branch according to a short howto from chrisjacob just add this little post-commit hook and everytime you commit something now the documentation of your elixir project is being generated by ex_doc from your current master branch.

First put this into a file called post-commit in <your_project>/.git/hooks

#!/bin/bash
git checkout master
mix docs
cd docs/
git checkout gh-pages
git add .
git commit -m "update documentation"
git push origin gh-pages

After that make sure it's executable by using

chmod +x <your_project>/.git/hooks/post-commit

and now you're ready to go.