If your repository is in the GitHub, you can serve your documentation using GitHub Pages easily. This guide shows how to setup GitHub pages with CroJSDoc.

See also Creating Project Pages manually - GitHub Help.

Clone your repository to the doc directory

# In your project root
$ git clone https://github.com/user/repository.git doc
Cloning into 'doc'...
done.

# Add doc to the ignore list
$ echo doc >> .gitignore

Create a gh-pages branch

$ cd doc

$ git checkout --orphan gh-pages
Switched to a new branch 'gh-pages'

$ git rm -rf .
rm '.gitignore'
...

Generate documentation

$ cd ..

$ crojsdoc
Total x files processed

Commit and push

$ cd doc

$ git add .

$ git commit -m 'Update documentation'

$ git push origin gh-pages

More options

If you delete master branch, you can omit repository and refspec arguments of git push.

$ git branch -D master

$ git push
Fork me on GitHub