Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis script to build+serve book from master #1

Merged
merged 1 commit into from Apr 25, 2018
Merged

Add Travis script to build+serve book from master #1

merged 1 commit into from Apr 25, 2018

Conversation

CAD97
Copy link
Contributor

@CAD97 CAD97 commented Apr 25, 2018

See https://github.com/crate-ci/cargo-ghp-upload for more about the ghp-upload tool.

Build will end up at https://rust-hosted-langs.github.io/book/master/.

This requires Travis to have write-access to your repository. The simplest (and reasonably secure) way to achieve this is to create a Persional API Access Token with public_repoo scope. Then on Travis, define the secure environment variable GH_TOKEN with the value being the new token.

If you want to provide more scoped access, you can use a deploy key for repo-specific access. If no token is provided, the script will use SSH to clone from and write to the repository. Travis Pro handles the deploy key automatically, and free users can use Travis encrypt-file plus a script to move the private key into the correct location.

This also means that cargo ghp-upload works locally so long as you have ssh set up for your account. Branch and origin context are collected from Git instead of the CI environment. This means that cargo ghp-upload will work on CI other than Travis, but you currently have to manually prevent it from running on PR builds if you don't wan't it to.

@pliniker
Copy link
Member

This is great, thanks!

@pliniker pliniker merged commit abf1905 into rust-hosted-langs:master Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants