2017-04-29 23:43:33 +08:00
|
|
|
#!/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
|
|
|
|
|
2017-07-28 00:32:21 +08:00
|
|
|
ln -sfn $VERSION latest
|
2017-04-29 23:43:33 +08:00
|
|
|
|
|
|
|
# Commit and publish
|
|
|
|
git add .
|
|
|
|
git commit -m "Update docs for v$VERSION"
|
|
|
|
git push origin gh-pages
|