Add back the old banner and add a condition to load on docs.pytorch.org #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Documentation Build | ||
Check failure on line 1 in .github/workflows/build-theme.yml
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main, pytorch_sphinx_theme2 ] | ||
workflow_dispatch: | ||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r docs/requirements.txt | ||
pip install -e . | ||
- name: Build theme assets | ||
run: | | ||
npx grunt default | ||
- name: Build Test documentation | ||
run: | | ||
cd docs | ||
sphinx-build -b html . _build/html | ||
- name: Upload documentation artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: documentation | ||
path: docs/_build/html/ | ||
doc-preview: | ||
runs-on: ubuntu-latest | ||
needs: build-docs | ||
if: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: documentation | ||
path: docs/_build/html | ||
- name: Upload docs preview | ||
uses: seemethere/upload-artifact-s3@v5 | ||
with: | ||
retention-days: 14 | ||
s3-bucket: doc-previews | ||
if-no-files-found: error | ||
path: docs/_build/html | ||
s3-prefix: pytorch_sphinx_theme/${{ github.event.pull_request.number } |