Here is a sample Travis CI .travis.yml configuration that ensures mdbook build and mdbook test run successfully.
The key to fast CI turnaround times is caching mdbook installs, so that you aren't compiling mdbook on every CI run.
Deploying Your Book to GitHub Pages
Following these instructions will result in your book being published to GitHub pages after a successful CI run on your repository's master branch.
First, create a new GitHub "Personal Access Token" with the "public_repo"permissions (or "repo" for private repositories).
Go to your repository's Travis CI settings page and add an environment variable named GITHUB_TOKEN that is marked secure and not shown in the logs.
Whilst still in your repository's settings page, navigate to Options and change the
Source on GitHub pages to gh-pages.
Then, append this snippet to your .travis.yml and update the path to the
book directory:
That's it!
Note: Travis has a new dplv2 configuration that is currently in beta. To use this new format, update your .travis.yml file to: