Github Pages¶
To deploy a documentation site (like this one), we currently use Github Pages
Travis can deploy the documentation to github pages.
-
Add a deploy stage to the
.travis.yml
file to deploy to github pages. A slightly more complex version is included in the example filestages: - test - name: deploy if: branch = master jobs: include: - stage: deploy # ensure docker is installed first before_script: sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce # The command to run, change this if using something different script: make docs-build deploy: provider: pages # The local directory where the documentation is built to local-dir: site skip-cleanup: true keep-history: true verbose: true github-token: $GITHUB_TOKEN on: branch: master
-
Generate a github token with write access to your repository.
- Add the token to the travis project.
- Either via the Travis Admin page
-
Or via the command line Travis CLI
travis env GITHUB_TOKEN <token>