Skip to content

Commit

Permalink
Test new GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-eric committed Jan 11, 2024
1 parent c83b5f3 commit 26cf522
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
# Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

name: Deploy Sphinx documentation to Pages

# Runs on pushes targeting the default branch
on:
push:
branches: [main]
branches: [ershi/github-pages-testing]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Build HTML
uses: ammaraskar/sphinx-action@master
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
docs-folder: "docs/"
build-command: "python ../build_docs.py"
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: python build_docs.py
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: html-docs
path: docs/_build/html/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
- name: Deploy to gh-pages
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git checkout --orphan gh-pages
git rm -rf .
mv docs/_build/html/* .
mv docs/_build/html/.nojekyll .
mv docs/_build/html/.buildinfo .
rm -rf docs warp
git add . .nojekyll .buildinfo
git commit -m "Deploy Sphinx documentation"
git push -f origin gh-pages
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.todo",
"sphinx.ext.extlinks", # Markup to shorten external links
"sphinx.ext.githubpages",
# Third-party extensions:
"sphinx_copybutton"
# 'sphinx_tabs.tabs',
Expand Down

0 comments on commit 26cf522

Please sign in to comment.