Skip to content

Instantly share code, notes, and snippets.

@bmegli
Created May 29, 2018 21:54
Show Gist options
  • Save bmegli/e22ba525dda0b197b2d4440d08f43ae2 to your computer and use it in GitHub Desktop.
Save bmegli/e22ba525dda0b197b2d4440d08f43ae2 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

@ziminas1990
Copy link

Very usefull and clear article!
Thank you!

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