Pyrofork: build-docs.sh: check refs before build docs

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-02-06 04:48:11 +07:00
parent 8353e5a2a2
commit afaf158183
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -3,17 +3,7 @@ export DOCS_KEY
VENV="$(pwd)"/venv
export VENV
make clean
make clean-docs
make venv
make api
"$VENV"/bin/pip install -e '.[docs]'
cd compiler/docs || exit 1 && "$VENV"/bin/python compiler.py
cd ../.. || exit 1
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
refs=$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")
if [[ "$refs" == "refs/tags" ]]; then
if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]]; then
branch="main"
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
branch="staging"
@ -30,6 +20,16 @@ else
exit 0
fi
fi
make clean
make clean-docs
make venv
make api
"$VENV"/bin/pip install -e '.[docs]'
cd compiler/docs || exit 1 && "$VENV"/bin/python compiler.py
cd ../.. || exit 1
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
cd pyrofork-docs || exit 1
mkdir -p "$branch"
cd "$branch" || exit 1