Skip to content

Github Pages

To deploy a documentation site (like this one), we currently use Github Pages

Travis can deploy the documentation to github pages.

  1. Add a deploy stage to the .travis.yml file to deploy to github pages. A slightly more complex version is included in the example file

    stages:
      - 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
    
  2. Generate a github token with write access to your repository.

  3. Add the token to the travis project.
    1. Either via the Travis Admin page
    2. Or via the command line Travis CLI

      travis env GITHUB_TOKEN <token>