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