Skip to content

Instantly share code, notes, and snippets.

@Integral
Created October 9, 2015 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Integral/4047d0afb324a25af876 to your computer and use it in GitHub Desktop.
Save Integral/4047d0afb324a25af876 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
branch=jsdoc
giturl=https://github.com/substance/substance.git
remoteurl=https://github.com/substance/docs.git
source=/tmp/substance
build=/tmp/substance/dist/doc
# Check to see if repo exists. If not, git clone it
if [ ! -d $source ]; then
git clone $giturl $source
fi
# Git checkout appropriate branch, pull latest code
cd $source
git checkout $branch
git pull origin $branch
cd -
# Run build script
cd $source
npm install
npm run doc
message=$(git log -1 --pretty=%B)
cd -
# Commit docs to gh pages
cd "$build"
git add .
git commit -m "$message"
git push origin gh-pages
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment