Skip to content

Commit 41c1bbf

Browse files
committed
update deploy action
1 parent b4c8144 commit 41c1bbf

File tree

6 files changed

+53
-14
lines changed

6 files changed

+53
-14
lines changed

โ€Ž.github/workflows/deploy-gh-pages.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ env:
1515
PYPI_CACHE_DIR: "_pip-wheels"
1616

1717
jobs:
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:

โ€ŽMakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docs:
3232
pip install -qq lightning # install (stable) Lightning from PyPI instead of src
3333
pip install -qq -r requirements/app/base.txt
3434
pip install -qq -r requirements/pytorch/docs.txt
35-
cd docs/source-pytorch && $(MAKE) html --jobs $(nproc)
35+
cd docs/source-pytorch && $(MAKE) html --jobs $(nproc) && cd ../../
3636

3737
update:
3838
git submodule update --init --recursive --remote

โ€Ždocs/source-app/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import shutil
1717
import sys
1818

19-
import lai_sphinx_theme
19+
# import lai_sphinx_theme
2020
from lightning_utilities.docs import fetch_external_assets
2121

2222
import lightning
@@ -82,7 +82,7 @@
8282
"sphinx_paramlinks",
8383
"sphinx_togglebutton",
8484
"sphinx.ext.githubpages",
85-
"lai_sphinx_theme.extensions.lightning",
85+
# "lai_sphinx_theme.extensions.lightning",
8686
]
8787

8888
# Add any paths that contain templates here, relative to this directory.
@@ -144,7 +144,8 @@
144144
# The theme to use for HTML and HTML Help pages. See the documentation for
145145
# a list of builtin themes.
146146
#
147-
html_theme = "lai_sphinx_theme"
147+
# html_theme = "lai_sphinx_theme"
148+
html_theme = "pt_lightning_sphinx_theme"
148149
html_theme_path = [os.environ.get('LIT_SPHINX_PATH', lai_sphinx_theme.get_html_theme_path())]
149150

150151
# Theme options are theme-specific and customize the look and feel of a theme

โ€Žrequirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# instead of install from source, use the pre-built wheel
2+
lightning
3+
14
# the default package dependencies
25
-r ./requirements/app/base.txt
36
-r ./requirements/pytorch/base.txt

โ€Žrequirements/app/docs.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
-r ../docs.txt
22

3-
lai-sphinx-theme
3+
# lai-sphinx-theme is not installable
4+
# refer: https://github.com/Lightning-AI/lightning/issues/16158
5+
# lai-sphinx-theme

โ€Žrequirements/pytorch/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ ipython[notebook]==8.10
66
setuptools==65.5.1
77

88
# pt-lightning-sphinx-theme @ https://github.com/Lightning-AI/lightning_sphinx_theme/archive/master.zip
9-
pt-lightning-sphinx-theme @ https://github.com/PyTorchKorea/lightning_sphinx_theme/archive/master.zip
9+
pt-lightning-sphinx-theme@https://github.com/PyTorchKorea/lightning_sphinx_theme/archive/master.zip
1010

1111
-r ../../_notebooks/.actions/requires.txt

0 commit comments

Comments
ย (0)