Skip to content

Commit 0fa6f18

Browse files
committed
automate deploying spec to gh-pages
1 parent e5b3965 commit 0fa6f18

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ script:
2222
branches:
2323
only:
2424
- master
25+
26+
after_success:
27+
- |
28+
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] \
29+
&& [[ "$TRAVIS_BRANCH" == "master" ]]
30+
then
31+
mkdir www
32+
cp rust.css www/
33+
cp spec.html www/index.html
34+
./deploy-gh-pages.sh
35+
fi

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
# tox-spec
1+
# The Tox Reference [![Build Status](https://travis-ci.org/zetok/tox-spec.svg?branch=master)](https://travis-ci.org/zetok/tox-spec)
22

3-
[![Build Status](https://api.travis-ci.org/TokTok/tox-spec.svg)](https://travis-ci.org/TokTok/tox-spec)
3+
To generate HTML, you will need to get [Rust], since it provides `rustdoc` that
4+
does the job.
45

5-
Tox Protocol Specification
6+
To generate `spec.html`:
7+
8+
```
9+
make spec.html
10+
```
11+
12+
Aside from `spec.html` you will want to include `rust.css` to get a nice
13+
formatting of the spec.
14+
15+
Alternatively, you can generate just a body part of the webpage using `Pandoc`:
16+
17+
```
18+
make spec-pandoc.html
19+
```
20+
21+
If you want to contribute, don't forget to make sure that text formatting is
22+
correct by running:
23+
24+
```
25+
make format
26+
git diff
27+
```
28+
29+
[Rust]: https://www.rust-lang.org

deploy-gh-pages.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# used in travis to deploy documentation to gh-pages branch
4+
5+
(
6+
cd www
7+
git init
8+
git config user.name "Travis CI"
9+
git config user.email "[email protected]"
10+
git add .
11+
git commit --quiet -m "Deploy to GH pages."
12+
git push --force --quiet "https://${GH_TOKEN}@github.com/zetok/tox-spec.git" master:gh-pages &> /dev/null
13+
)

0 commit comments

Comments
 (0)