forked from mirrors/probot
Update publish-docs to copy API docs to website
This commit is contained in:
parent
9ed2744cfc
commit
36332f8c7b
|
@ -4,3 +4,4 @@ node_modules/
|
|||
*.pem
|
||||
.env
|
||||
out
|
||||
tmp
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"opts": {
|
||||
"readme": "docs/plugins.md",
|
||||
"template": "node_modules/minami"
|
||||
},
|
||||
"source": {
|
||||
|
|
|
@ -2,30 +2,32 @@
|
|||
|
||||
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
|
||||
# Checkout the website into the tmp directory
|
||||
[ -d tmp/website ] || {
|
||||
mkdir -p tmp
|
||||
git clone https://github.com/probot/probot.github.io tmp/website
|
||||
}
|
||||
|
||||
# Update the website checkout
|
||||
cd tmp/website
|
||||
git pull origin master
|
||||
|
||||
# Delete previously generated docs for this version
|
||||
rm -rf $VERSION
|
||||
mv probot/$VERSION .
|
||||
rmdir probot
|
||||
rm -rf api/$VERSION
|
||||
|
||||
ln -sfn $VERSION latest
|
||||
# Copy over the new docs
|
||||
mv ../../out/probot/$VERSION api/$VERSION
|
||||
|
||||
ln -sfn $VERSION api/latest
|
||||
|
||||
# Commit and publish
|
||||
git add .
|
||||
git commit -m "Update docs for v$VERSION"
|
||||
git push origin gh-pages
|
||||
git tag v$VERSION
|
||||
git push --tags origin master
|
||||
|
|
Loading…
Reference in New Issue