1515 PYPI_CACHE_DIR : " _pip-wheels"
1616
1717jobs :
18- build :
18+ make-html :
1919 runs-on : ubuntu-latest
2020 container :
2121 image : pytorchlightning/pytorch_lightning:docs
22+ strategy :
23+ fail-fast : false
24+ matrix :
25+ pkg-name : ["app", "fabric", "pytorch"]
2226 steps :
2327 - uses : actions/checkout@v3
2428 with :
@@ -37,18 +41,47 @@ jobs:
3741 ls -lh $PYPI_CACHE_DIR
3842 mkdir -p pypi_pkgs # in case template is not pulled
3943 pip --version
40- pip install -U -r requirements.txt \
41- -f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
42- pip install -U -r requirements/docs.txt \
44+ pip install -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
4345 -f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
4446 pip list
4547 shell : bash
4648
47- - name : Build Sphinx documents
48- run : |
49- git config --global --add safe.directory /
50- make docs
49+ - name : Make Documentation
50+ working-directory : ./docs/source-${{ matrix.pkg-name }}
51+ run : make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
52+
53+ - name : Keep artifact
54+ id : keep-artifact
55+ run : python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
56+
57+ - name : Upload built docs
58+ uses : actions/upload-artifact@v3
59+ with :
60+ name : docs-${{ matrix.pkg-name }}-${{ github.sha }}
61+ path : docs/build/html/
62+ retention-days : ${{ steps.keep-artifact.outputs.DAYS }}
5163
64+ - name : Dump handy wheels
65+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
66+ continue-on-error : true
67+ uses : ./.github/actions/pip-wheels
68+ with :
69+ wheel-dir : ${{ env.PYPI_CACHE_DIR }}
70+ torch-url : ${{ env.TORCH_URL }}
71+ cache-key : " pypi_wheels"
72+
73+ deploy-docs :
74+ needs : [make-html]
75+ runs-on : ubuntu-latest
76+ strategy :
77+ fail-fast : false
78+ matrix :
79+ pkg-name : ["app", "fabric", "pytorch"]
80+ steps :
81+ - uses : actions/download-artifact@v3
82+ with :
83+ name : docs-${{ matrix.pkg-name }}-${{ github.sha }}
84+ path : docs/build/html/
5285 - name : Deploy to gh-pages branch
5386 uses : peaceiris/actions-gh-pages@v3
5487 with :
0 commit comments