2015-08-01 21:24:00 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-08-06 02:47:21 +08:00
|
|
|
# Exit on error or variable unset
|
2015-08-01 21:24:00 +08:00
|
|
|
set -o errexit -o nounset
|
|
|
|
|
|
|
|
rev=$(git rev-parse --short HEAD)
|
|
|
|
|
2015-08-06 02:47:21 +08:00
|
|
|
# Run mdbook to generate the book
|
|
|
|
target/debug/mdbook build book-example/
|
|
|
|
|
2015-08-01 21:24:00 +08:00
|
|
|
cd book-example/book
|
|
|
|
|
2015-08-06 02:47:21 +08:00
|
|
|
|
2015-08-01 21:24:00 +08:00
|
|
|
git init
|
|
|
|
git config user.name "Mathieu David"
|
|
|
|
git config user.email "mathieudavid@mathieudavid.org"
|
|
|
|
|
|
|
|
git remote add upstream "https://$GH_TOKEN@github.com/azerupi/mdBook.git"
|
|
|
|
git fetch upstream
|
|
|
|
git reset upstream/gh-pages
|
|
|
|
|
|
|
|
touch .
|
|
|
|
|
|
|
|
git add -A .
|
|
|
|
git commit -m "rebuild pages at ${rev}"
|
|
|
|
git push -q upstream HEAD:gh-pages
|