@@ -9,80 +9,23 @@ defaults:
99 run :
1010 shell : bash
1111
12- env :
13- FREEZE_REQUIREMENTS : " 1"
14- TORCH_URL : " https://download.pytorch.org/whl/cpu/torch_stable.html"
15- PYPI_CACHE_DIR : " _pip-wheels"
16-
1712jobs :
1813 make-html :
1914 runs-on : ubuntu-latest
20- container :
21- image : pytorchlightning/pytorch_lightning:docs
22- strategy :
23- fail-fast : false
24- matrix :
25- pkg-name : ["app", "fabric", "pytorch"]
2615 steps :
27- - uses : actions/checkout@v3
16+ - name : Make Sphinx documentation for PyTorchLightning
17+ uses : actions/checkout@v3
2818 with :
2919 submodules : true
30-
31- - name : pip wheels cache
32- uses : actions/cache/restore@v3
33- with :
34- path : ${{ env.PYPI_CACHE_DIR }}
35- key : pypi_wheels
36-
37- - name : Install package & dependencies
38- run : |
39- mkdir -p $PYPI_CACHE_DIR # in case cache was not hit
40- ls -lh $PYPI_CACHE_DIR
41- mkdir -p pypi_pkgs # in case template is not pulled
42- pip --version
43- pip install -U -r requirements.txt \
44- -f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
45- pip install -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
46- -f pypi_pkgs/ -f $PYPI_CACHE_DIR -f ${TORCH_URL}
47- pip list
48- shell : bash
49-
50- - name : Make Documentation
51- working-directory : ./docs/source-${{ matrix.pkg-name }}
52- run : make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
53-
54- - name : Keep artifact
55- id : keep-artifact
56- run : python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
57-
58- - name : Upload built docs
59- uses : actions/upload-artifact@v3
20+ - uses : actions/setup-python@v4
6021 with :
61- name : docs-${{ matrix.pkg-name }}-${{ github.sha }}
62- path : docs/build/html/
63- retention-days : ${{ steps.keep-artifact.outputs.DAYS }}
64-
65- - name : Dump handy wheels
66- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
22+ python-version : ' 3.10'
23+ cache : ' pip'
24+ - run : |
25+ git config --global --add safe.directory '*' # to allow sphinx to write to any directory
26+ make docs
6727 continue-on-error: true
68- uses : ./.github/actions/pip-wheels
69- with :
70- wheel-dir : ${{ env.PYPI_CACHE_DIR }}
71- torch-url : ${{ env.TORCH_URL }}
72- cache-key : " pypi_wheels"
7328
74- deploy-docs :
75- needs : [make-html]
76- runs-on : ubuntu-latest
77- strategy :
78- fail-fast : false
79- matrix :
80- pkg-name : ["app", "fabric", "pytorch"]
81- steps :
82- - uses : actions/download-artifact@v3
83- with :
84- name : docs-${{ matrix.pkg-name }}-${{ github.sha }}
85- path : docs/build/html/
8629 - name : Deploy to gh-pages branch
8730 uses : peaceiris/actions-gh-pages@v3
8831 with :
0 commit comments