Merge pull request #1373 from avisionh/docs/ci-guide-update
Docs: CI guide update
This commit is contained in:
commit
59f2a9bf4e
|
@ -39,6 +39,9 @@ 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
|
CI settings page and add an environment variable named `GITHUB_TOKEN` that is
|
||||||
marked secure and *not* shown in the logs.
|
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
|
Then, append this snippet to your `.travis.yml` and update the path to the
|
||||||
`book` directory:
|
`book` directory:
|
||||||
|
|
||||||
|
@ -55,6 +58,40 @@ deploy:
|
||||||
|
|
||||||
That's it!
|
That's it!
|
||||||
|
|
||||||
|
Note: Travis has a new [dplv2](https://blog.travis-ci.com/2019-08-27-deployment-tooling-dpl-v2-preview-release) configuration that is currently in beta. To use this new format, update your `.travis.yml` file to:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
language: rust
|
||||||
|
os: linux
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- cargo
|
||||||
|
|
||||||
|
rust:
|
||||||
|
- stable
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
|
||||||
|
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.3" mdbook)
|
||||||
|
- cargo install-update -a
|
||||||
|
|
||||||
|
script:
|
||||||
|
- mdbook build path/to/mybook && mdbook test path/to/mybook
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: pages
|
||||||
|
strategy: git
|
||||||
|
edge: true
|
||||||
|
cleanup: false
|
||||||
|
github-token: $GITHUB_TOKEN
|
||||||
|
local-dir: path/to/mybook/book
|
||||||
|
keep-history: false
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
target_branch: gh-pages
|
||||||
|
```
|
||||||
|
|
||||||
### Deploying to GitHub Pages manually
|
### Deploying to GitHub Pages manually
|
||||||
|
|
||||||
If your CI doesn't support GitHub pages, or you're deploying somewhere else
|
If your CI doesn't support GitHub pages, or you're deploying somewhere else
|
||||||
|
|
|
@ -16,5 +16,6 @@ shout-out to them!
|
||||||
- [Phaiax](https://github.com/Phaiax)
|
- [Phaiax](https://github.com/Phaiax)
|
||||||
- Matt Ickstadt ([mattico](https://github.com/mattico))
|
- Matt Ickstadt ([mattico](https://github.com/mattico))
|
||||||
- Weihang Lo ([@weihanglo](https://github.com/weihanglo))
|
- Weihang Lo ([@weihanglo](https://github.com/weihanglo))
|
||||||
|
- Avision Ho ([@avisionh](https://github.com/avisionh))
|
||||||
|
|
||||||
If you feel you're missing from this list, feel free to add yourself in a PR.
|
If you feel you're missing from this list, feel free to add yourself in a PR.
|
||||||
|
|
Loading…
Reference in New Issue