Skip to content

Instantly share code, notes, and snippets.

@sparkida
Created March 2, 2017 16:21
Show Gist options
  • Save sparkida/16bc2145936effc06845d4c869d8454b to your computer and use it in GitHub Desktop.
Save sparkida/16bc2145936effc06845d4c869d8454b to your computer and use it in GitHub Desktop.
build github pages
#!/usr/bin/env bash
currentBranch="`git branch | while read line; do if [[ "$line" =~ ^\* ]]; then echo ${line:2}; fi; done`"
if [ -d docs ]; then
rm -rf docs
fi
./node_modules/.bin/jsdoc -c jsdoc.json
git stash
git checkout gh-pages
mv -f ./docs/*.html .
rm -rf docs
git commit -am 'updated docs'
git push origin gh-pages
git checkout "$currentBranch"
git stash pop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment