Skip to content

Commit

Permalink
docs: switch to use LAI sphinx template
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 22, 2024
1 parent b8074a0 commit 40646a3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,51 @@ defaults:

jobs:
docs-make:
uses: Lightning-AI/utilities/.github/workflows/check-docs.yml@v0.11.0
with:
python-version: "3.10"
requirements-file: "requirements/docs.txt"
install-tex: true
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target: ["html", "doctest", "linkcheck"]
env:
ARTIFACT_DAYS: 0
PYPI_LOCAL_DIR: "pypi_pkgs/"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Pull sphinx template
run: |
pip install -q -r requirements/ci.txt
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
- name: Install pandoc
timeout-minutes: 5
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y pandoc
- name: Install package & dependencies
timeout-minutes: 20
run: pip install . -U -r requirements/docs.txt

- name: Make ${{ matrix.target }}
working-directory: docs/source/
# allow failing link check and doctest if you run with dispatch
continue-on-error: ${{ matrix.target == 'doctest' || matrix.target == 'linkcheck' }}
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"

- name: Keep artifact
if: github.event_name == 'pull_request'
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
- name: Upload built docs
if: ${{ matrix.target == 'html' }}
uses: actions/upload-artifact@v4
with:
name: docs-html-${{ github.sha }}
path: docs/build/html/
retention-days: ${{ env.ARTIFACT_DAYS }}

deploy-docs:
needs: docs-make
Expand All @@ -28,7 +68,7 @@ jobs:
env:
GCP_TARGET: "gs://lightning-docs-thunder"
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: docs-html-${{ github.sha }}
path: docs/build/
Expand Down
4 changes: 3 additions & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ docutils >=0.16
sphinxcontrib-fulltoc ==1.2.0
sphinxcontrib-mockautodoc

pt-lightning-sphinx-theme @ https://github.com/Lightning-AI/lightning_sphinx_theme/archive/master.zip
sphinx-autodoc-typehints ==1.23.0
sphinx-paramlinks ==0.6.0
sphinx-togglebutton ==0.3.2
sphinx-copybutton ==0.5.2

# installed from S3 location and fetched in advance
lai-sphinx-theme

0 comments on commit 40646a3

Please sign in to comment.