lightning/.github/workflows/docs-build.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

181 lines
5.8 KiB
YAML
Raw Normal View History

name: Build Docs
# https://github.com/marketplace/actions/sphinx-build
on:
push:
branches: ["master", "release/*"]
tags: ["*"]
# use this event type to share secrets with forks.
# it's important that the PR head SHA is checked out to run the changes
pull_request_target:
branches: ["master", "release/*"]
paths:
- ".actions/**"
2023-03-05 10:41:00 +00:00
- ".github/workflows/docs-build.yml"
- "requirements/**"
2022-11-02 21:27:25 +00:00
- "docs/**"
- "src/**"
- "setup.py"
- "pyproject.toml" # includes metadata used in the package creation
2022-11-16 10:07:02 +00:00
- "!*.md"
- "!**/*.md"
2022-02-02 19:48:15 +00:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
defaults:
run:
shell: bash
env:
FREEZE_REQUIREMENTS: "1"
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
2023-03-05 10:41:00 +00:00
PYPI_CACHE: "_pip-wheels"
jobs:
make-doctest:
2023-01-14 03:02:10 +00:00
runs-on: ubuntu-latest
container:
image: pytorchlightning/pytorch_lightning:docs
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "fabric", "pytorch"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: aws-actions/configure-aws-credentials@v2
if: ${{ matrix.pkg-name != 'pytorch' }}
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-region: us-east-1
- run: aws s3 sync s3://sphinx-packages/ pypi/
if: ${{ matrix.pkg-name != 'pytorch' }}
2023-03-05 10:41:00 +00:00
- name: pip wheels cache
uses: actions/cache/restore@v3
with:
2023-03-05 10:41:00 +00:00
path: ${{ env.PYPI_CACHE }}
key: pypi_wheels
2023-03-05 10:41:00 +00:00
- name: Install package
run: |
2023-03-05 10:41:00 +00:00
mkdir -p $PYPI_CACHE
ls -lh $PYPI_CACHE
pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg-name }}/docs.txt -f pypi -f ${TORCH_URL}
pip list
- name: Test Documentation
env:
SPHINX_MOCK_REQUIREMENTS: 0
working-directory: ./docs/source-${{ matrix.pkg-name }}
run: |
make doctest
make coverage
2023-03-05 10:41:00 +00:00
make-html:
2023-01-14 03:02:10 +00:00
runs-on: ubuntu-latest
container:
image: pytorchlightning/pytorch_lightning:docs
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "fabric", "pytorch"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: aws-actions/configure-aws-credentials@v2
if: ${{ matrix.pkg-name != 'pytorch' }}
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-region: us-east-1
- run: aws s3 sync s3://sphinx-packages/ pypi/
if: ${{ matrix.pkg-name != 'pytorch' }}
2023-03-05 10:41:00 +00:00
- name: pip wheels cache
uses: actions/cache/restore@v3
with:
2023-03-05 10:41:00 +00:00
path: ${{ env.PYPI_CACHE }}
key: pypi_wheels
2022-11-01 00:44:58 +00:00
- name: Install package & dependencies
run: |
2023-03-05 10:41:00 +00:00
mkdir -p $PYPI_CACHE
ls -lh $PYPI_CACHE
pip --version
pip install -e . -U -r requirements/${{ matrix.pkg-name }}/docs.txt -f pypi -f ${TORCH_URL}
2020-09-30 12:37:52 +00:00
pip list
shell: bash
- name: Make Documentation
working-directory: ./docs/source-${{ matrix.pkg-name }}
run: make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
- name: Check External Links in Sphinx Documentation (Optional)
working-directory: ./docs/source-${{ matrix.pkg-name }}
run: make linkcheck
continue-on-error: true
- name: Keep artifact
id: keep-artifact
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
- name: Upload built docs
uses: actions/upload-artifact@v3
with:
2022-11-02 13:00:48 +00:00
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
path: docs/build/html/
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
2023-03-05 10:41:00 +00:00
deploy-docs:
needs: [make-doctest, make-html]
if: github.repository_owner == 'Lightning-AI' && github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pkg-name: ["app", "fabric", "pytorch"]
steps:
- uses: actions/download-artifact@v3
with:
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
path: docs/build/html/
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCS_SA_KEY }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCS_PROJECT }}
# Uploading docs to GCS, so they can be served on lightning.ai
2023-03-07 15:39:52 +00:00
- name: Upload docs/${{ matrix.pkg-name }}/stable to GCS 🪣
2023-03-05 10:41:00 +00:00
if: startsWith(github.ref, 'refs/heads/release/')
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/stable
# Uploading docs to GCS, so they can be served on lightning.ai
2023-03-07 15:39:52 +00:00
- name: Upload docs/${{ matrix.pkg-name }}/latest to GCS 🪣
2023-03-05 10:41:00 +00:00
if: github.ref == 'refs/heads/master'
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/latest
# Uploading docs to GCS, so they can be served on lightning.ai
2023-03-07 15:39:52 +00:00
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
if: startsWith(github.ref, 'refs/tags/')
run: gsutil -m rsync -d -R docs/build/html/ gs://lightning-docs-${{ matrix.pkg-name }}/${{ github.ref_name }}"