Skip to content

Commit

Permalink
gh-pages script
Browse files Browse the repository at this point in the history
Add gh-pages script to publish docs.
  • Loading branch information
rhys-vdw committed Jun 28, 2016
1 parent ab426d9 commit 96b7668
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -10,7 +10,10 @@
"lint": "eslint bookshelf.js src/",
"cover": "npm run lint && istanbul cover _mocha -- --check-leaks -t 5000 -b -R spec test/index.js",
"test": "npm run lint && npm run build && mocha --check-leaks -t 5000 -b test/index.js",
"jsdoc": "./scripts/jsdoc.sh"
"jsdoc": "./scripts/jsdoc.sh",
"gh-pages": "./scripts/gh-pages.sh",
"prepublish": "npm run test",
"postpublish": "npm run gh-pages"
},
"homepage": "http://bookshelfjs.org",
"repository": {
Expand Down
19 changes: 19 additions & 0 deletions scripts/gh-pages.sh
@@ -0,0 +1,19 @@
#!/bin/bash -e

# Checkout and update gh-pages branch.
git checkout -B gh-pages origin/gh-pages

# Update to master.
git pull origin master

# Regenate documentation.
npm run jsdoc

# We must force add because these are usually ignored.
git add --force --all index.html docs

# Commit changes.
git commit -m "Update docs"

# Push the update.
git push origin gh-pages

0 comments on commit 96b7668

Please sign in to comment.