Skip to content

Instantly share code, notes, and snippets.

@bryanmtl
Created February 8, 2018 17:06
Show Gist options
  • Save bryanmtl/0f4ea102a8182f89220d371b0ad1a124 to your computer and use it in GitHub Desktop.
Save bryanmtl/0f4ea102a8182f89220d371b0ad1a124 to your computer and use it in GitHub Desktop.
Gitbook -> GH Pages
#!/bin/bash
# install the plugins and build the static site
gitbook install && gitbook build
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages --rebase
# copy the static site files into the current directory.
cp -R _book/* .
# remove 'node_modules' and '_book' directory
git clean -fx node_modules
git clean -fx _book
# add all files
git add .
# commit
git commit -a -m "Update docs"
# push to the origin
git push origin gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment