Easily import a folder to your gh-pages branch!
I wrote this tool to help people who want to host documentation or anything on a gh-pages
branch. This was heavily influenced by ghp-import and has a similar implementation.
The documentation can be found here. The documentation is powered by cargo doc
and ghp-rs
. Check out the .travis.yml and the travis setup for an example of how to use ghp-rs
with rustdoc
.
bash
cargo install ghp
Coming Soon!
bash
git clone https://github.com/LucioFranco/ghp-rs
cargo build --release
export PATH="$PATH:/path/to/ghp-rs"
```bash ghp [OPTIONS] DIRECTORY
ghp build # move content of build folder to gh-pages branch
ghp --branch website build # will move the contents of the build folder to the website branch
ghp --message "This is a git commit message" build ```
Cargo.toml
toml
[dependencies]
ghp = "0.1"
```rust extern crate ghp; use ghp::import_dir;
import_dir("build", "gh-pages", "commit message").unwrap(); ```
For this you will need to have a GH_TOKEN
variable with your github personal token. Read more here.
yaml
after_success: |
[ $TRAVIS_RUST_VERSION = stable ] &&
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
ghp target/doc &&
git config user.name "Travis Documentation" &&
git config user.email "name@example.com" &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.