3 # Exit on error or variable unset
4 set -o errexit
-o nounset
10 rev=$
(git rev-parse
--short HEAD
)
12 echo -e "${CYAN}Running cargo doc${NC}"
16 echo -e "${CYAN}Running mdbook build${NC}"
17 # Run mdbook to generate the book
18 target
/"$TARGET"/debug
/mdbook build book-example
/
20 echo -e "${CYAN}Copying book to target/doc${NC}"
21 # Copy files from rendered book to doc root
22 cp -R book-example
/book
/* target
/doc
/
26 echo -e "${CYAN}Initializing Git${NC}"
28 git config user.name
"Mathieu David"
29 git config user.email
"mathieudavid@mathieudavid.org"
31 git remote add upstream
"https://$GH_TOKEN@github.com/azerupi/mdBook.git"
33 git
reset upstream
/gh-pages
37 echo -e "${CYAN}Pushing changes to gh-pages${NC}"
39 git commit
-m "rebuild pages at ${rev}"
40 git push
-q upstream HEAD
:gh-pages
42 echo -e "${GREEN}Deployement done${NC}"