Last active
January 13, 2019 20:56
-
-
Save omrilotan/6df8ee479ff34711116e3257384255e7 to your computer and use it in GitHub Desktop.
Autometed pushing of new versions of docs to gh-pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
# Continue only on 'master' | |
if [[ $CURRENT_BRANCH -ne 'master' ]]; then | |
exit; | |
fi | |
# Clone the branch and remove it's content | |
git clone -b gh-pages --single-branch https://github.com/<ORGENISATION>/<REPOSITORY>.git DOCS | |
rm -rf DOCS/* | |
echo "Building docs" | |
./node_modules/jsdoc/jsdoc.js lib/ -c .jsdocrc.json | |
# Push the new changes | |
cd DOCS | |
git add . | |
git commit -m "Updating the docs" | |
git push origin gh-pages | |
cd - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment