Script to publish docs

This commit is contained in:
Brandon Keepers 2017-04-29 10:43:33 -05:00
parent 3875150bea
commit fafac05011
No known key found for this signature in database
GPG Key ID: F9533396D5FACBF6
1 changed files with 31 additions and 0 deletions

31
script/publish-docs Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
set -e
# Checkout the gh-pages branch into the "out" directory
[ -d ./out ] || git worktree add out origin/gh-pages
# Update checkout
cd out
git pull origin gh-pages
cd ..
# Store the versions
VERSION=$(npm view probot version)
# Generate docs
npm run doc
cd out
# Delete previously generated docs for this version
rm -rf $VERSION
mv probot/$VERSION .
rmdir probot
ln -sf $VERSION latest
# Commit and publish
git add .
git commit -m "Update docs for v$VERSION"
git push origin gh-pages