Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JarekParal/015806ad4e5c096e0f060407b12a32c9 to your computer and use it in GitHub Desktop.
Save JarekParal/015806ad4e5c096e0f060407b12a32c9 to your computer and use it in GitHub Desktop.
Doxygen with Travis CI to gh-pages

Setup github project so that after any change to master branch doxygen documentation is generated and pushed to gh-pages by Travis CI

  1. Add clean gh-pages branch to your repository
git checkout --orphan gh-pages
git rm -rf .
echo "my gh-pages branch" > README.md
git add .
git commit -a -m "clean gh-pages branch"
git push origin gh-pages
  1. Add Doxyfile to master branch of your repository
  2. Sign up for Travis CI and enable your project
  3. Generate personal access tokens with public_repo scope
  4. Add this token in Travis CI -> Your Project -> Settings -> Environment Variables as GH_REPO_TOKEN
  5. Add .travis.yml to master branch of your repository:
sudo: false

branches:
  only:
    - master

addons:
  apt:
    packages:
      - doxygen

script:
  - doxygen Doxyfile

deploy:
  provider: pages
  skip_cleanup: true
  local_dir: docs/html
  github_token: $GH_REPO_TOKEN
  on:
    branch: master

Troubleshoot if needed watching Travis CI output for your project.

Your documentation will be available at: https://[your github user].github.io/[your github project]/

Working example / documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment