ci/rtfd: building both fast docs on PR (#18738)

This commit is contained in:
Jirka Borovec 2023-10-07 18:57:50 +09:00 committed by GitHub
parent 87dff9928e
commit 0777aab31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 8 deletions

View File

@ -39,12 +39,15 @@ build:
commands: commands:
- printenv - printenv
- pwd ; ls -lh - pwd ; ls -lh
- pip install -U pip awscli --user - pip install -U pip awscli py-tree --user
- python -m awscli s3 sync --no-sign-request s3://sphinx-packages/ dist/ ; ls -lh dist/ - python -m awscli s3 sync --no-sign-request s3://sphinx-packages/ dist/ ; ls -lh dist/
- > - >
pip install -e . -q -r requirements/pytorch/docs.txt -r _notebooks/.actions/requires.txt \ pip install -e . -q -r _notebooks/.actions/requires.txt \
-r requirements/fabric/docs.txt \
-r requirements/pytorch/docs.txt \
-f 'https://download.pytorch.org/whl/cpu/torch_stable.html' -f dist/ ; -f 'https://download.pytorch.org/whl/cpu/torch_stable.html' -f dist/ ;
pip list pip list
# this need to be split so `sphinx-build` is picked from previous installation # this need to be split so `sphinx-build` is picked from previous installation
- bash docs/rtfd-build.sh - bash docs/rtfd-build.sh
- mkdir -p _readthedocs ; mv docs/build/html _readthedocs/html - cd docs/build ; python -m py_tree --depth_limit=1
- mkdir -p _readthedocs ; mv docs/build _readthedocs/html

15
docs/crossroad.html Normal file
View File

@ -0,0 +1,15 @@
<!doctype html>
<html>
<head>
<title>RTFD cross-road</title>
<style>
body {
text-align: center;
}
</style>
</head>
<body>
<a href="fabric/"><button>Fabric</button></a>
<a href="pytorch/"><button>PyTorch</button></a>
</body>
</html>

View File

@ -2,12 +2,23 @@
if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ]; if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ];
then then
cd ./docs/source-pytorch ;
export FAST_DOCS_DEV=1 ; export FAST_DOCS_DEV=1 ;
make html --jobs $(nproc) ; root=$(pwd) ;
ls -lh ../build # build Fabric
cd $root/docs/source-fabric ;
make html --jobs $(nproc) ;
cd $root/docs ;
mv build/html build/fabric ;
# build PyTorch
cd $root/docs/source-pytorch ;
make html --jobs $(nproc) ;
cd $root/docs ;
mv build/html build/pytorch ;
# cross-road
rm -rf build/doctrees ;
cp crossroad.html build/index.html
else else
echo "Void build... :-]" ; echo "Void build... :-]" ;
mkdir -p ./docs/build/html mkdir -p ./docs/build
cp ./docs/redirect.html ./docs/build/html/index.html cp ./docs/redirect.html ./docs/build/index.html
fi fi