Skip to content

Commit

Permalink
docs: Generate API documentation for release branch (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Oct 3, 2023
1 parent 74ff091 commit c6a3966
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions release_docs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/sh -e
set -x
# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh

if [ "${GITHUB_ACTIONS}" = "" ];
then
echo "Cannot release docs without GITHUB_ACTIONS set"
exit 0;
fi
if [ "${SOURCE_TAG}" = "" ];
then
echo "Cannot release docs without SOURCE_TAG set"
exit 0;
fi
REPO="https://github.com/parse-community/Parse-SDK-JS"

rm -rf docs
Expand All @@ -13,16 +20,16 @@ cd docs
git pull origin gh-pages
cd ..

DEST="master"
RELEASE="release"
VERSION="${SOURCE_TAG}"

if [ "${SOURCE_TAG}" != "" ];
then
DEST="${SOURCE_TAG}"
# change the default page to the latest
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${DEST}'>" > "docs/api/index.html"
fi
# change the default page to the latest
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${VERSION}'>" > "docs/api/index.html"

npm run docs

mkdir -p "docs/api/${DEST}"
cp -R out/* "docs/api/${DEST}"
mkdir -p "docs/api/${RELEASE}"
cp -R out/* "docs/api/${RELEASE}"

mkdir -p "docs/api/${VERSION}"
cp -R out/* "docs/api/${VERSION}"

0 comments on commit c6a3966

Please sign in to comment.