Last active
January 3, 2017 19:23
-
-
Save oliverroick/067def5929ad94e35523bd89e7f49309 to your computer and use it in GitHub Desktop.
Bash script to deploy Docbox documentation
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
#!/bin/bash | |
cd docs | |
rm -rf dddocs | |
rm -rf docs-build | |
mkdir docs-build | |
npm install | |
npm run build | |
git clone -b gh-pages --single-branch git@github.com:[YOUR ORG]/[YOUR REPOSITORY].git dddocs | |
yes | cp -rf docs-build/index.html dddocs | |
yes | cp -rf docs-build/bundle.js dddocs | |
yes | cp -rf css/* dddocs/css | |
yes | cp -rf lib/* dddocs/lib | |
cd dddocs | |
if [[ $(git diff) ]]; then | |
echo "Deploying..." | |
git add . | |
git commit -m 'Deploy docs' | |
git push origin gh-pages | |
else | |
echo "Nothing to deploy." | |
fi | |
echo "Cleaning up..." | |
cd .. | |
rm -rf dddocs | |
rm -rf docs-build | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment