bigbluebutton-Github/docs/build.sh
timo d9fd33ef93 Build docs only on develop
From now on the docs will only be build on develop and not on the
release branches.

This commit adjusts the build script and the docusaurus.config on
develop and the gh-action workflow accordingly.
2023-03-21 17:33:43 +01:00

33 lines
679 B
Bash
Executable File

#!/bin/bash
set -eu
# Build the docs only for these release branches
BRANCHES=(
v2.5.x-release
v2.6.x-release
# v2.7.x-release
)
REMOTE="origin"
git fetch --all
current_branch=$(git rev-parse --abbrev-ref HEAD)
for branch in "${BRANCHES[@]}"; do
if [ "$branch" != "$current_branch" ]; then
git fetch "$REMOTE" "$branch":"$branch"
git checkout "$branch"
if [ -f docusaurus.config.js ]; then
version=${branch:1:3}
echo "Adding documentation for ${version}"
yarn docusaurus docs:version "${version}"
else
echo "Warning: branch $(branch) does not contain a docusaurus.config.js!"
fi
fi
done
git checkout "$current_branch"