-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Add documentation generation workflow.
- Loading branch information
1 parent
1f2a3c3
commit 73132f3
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
name: Generate Documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
source_ref: | ||
description: 'Branch/commit/tag to checkout.' | ||
required: true | ||
type: string | ||
dest_dir: | ||
description: 'Destination directory to produce output in `docs/` folder.' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.source_ref }} | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip build wheel virtualenv | ||
pip install -r docs/requirements.txt | ||
- name: Generate Docs | ||
run: | | ||
sphinx-build -b html docs build | ||
- name: Add/Update Docs | ||
run: | | ||
git fetch origin gh-pages | ||
git checkout gh-pages | ||
git rm "docs/$DEST_DOCS_DIR" -r -f --ignore-unmatch | ||
git add build/ | ||
git mv build "docs/$DEST_DOCS_DIR" | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
git commit -a -m "[docs] @${{ github.triggering_actor }}: Generate Website" | ||
git push | ||
env: | ||
DEST_DOCS_DIR: ${{ inputs.dest_dir }} |
This file contains 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