From afaf15818322f3c9a08ef4843deb36b7df4d3590 Mon Sep 17 00:00:00 2001 From: wulan17 Date: Tue, 6 Feb 2024 04:48:11 +0700 Subject: [PATCH] Pyrofork: build-docs.sh: check refs before build docs Signed-off-by: wulan17 --- build-docs.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build-docs.sh b/build-docs.sh index 100e04ac..6bdcf148 100644 --- a/build-docs.sh +++ b/build-docs.sh @@ -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