Skip to content

Commit 3ba363d

Browse files
Merge pull request #2192 from frewsxcv/frewsxcv-publish
Publish RFCs as mdbook to GitHub Pages.
2 parents d046f39 + c3c92eb commit 3ba363d

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*~
2+
book/
3+
src/

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: rust
2+
before_install:
3+
- openssl aes-256-cbc -K $encrypted_1cc96cfefdcd_key -iv $encrypted_1cc96cfefdcd_iv -in rfcs-publish-key.enc -out ~/.ssh/rfcs-publish-key -d
4+
- chmod u=rw,og= ~/.ssh/rfcs-publish-key
5+
- echo "Host github.com" >> ~/.ssh/config
6+
- echo " IdentityFile ~/.ssh/rfcs-publish-key" >> ~/.ssh/config
7+
- git --version
8+
script:
9+
- rev=$(git rev-parse --short HEAD)
10+
- (cargo install mdbook --git https://github.com/azerupi/mdBook.git --force || true)
11+
- ./generate-book.sh
12+
- cd book
13+
- git init
14+
- git config --global user.name "bors"
15+
- git config --global user.email "[email protected]"
16+
- git remote add upstream [email protected]:rust-lang/rfcs.git
17+
- git fetch upstream
18+
- git reset upstream/gh-pages
19+
- touch .
20+
- git add -A .
21+
- git commit -m "Rebuild book at ${rev}"
22+
- git push -q upstream HEAD:gh-pages > /dev/null 2>&1
23+
branches:
24+
only:
25+
- master
26+

generate-book.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ ! -d src ]; then
6+
mkdir src
7+
fi
8+
9+
echo "[Introduction](introduction.md)\n" > src/SUMMARY.md
10+
11+
for f in $(ls text/* | sort)
12+
do
13+
echo "- [$(basename $f ".md")]($(basename $f))" >> src/SUMMARY.md
14+
cp $f src
15+
done
16+
17+
cp README.md src/introduction.md
18+
19+
mdbook build

rfcs-publish-key.enc

1.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)