Skip to content

Commit

Permalink
[build] Add documentation generation workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Breakthrough committed Jul 1, 2023
1 parent 1f2a3c3 commit 73132f3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/generate-docs.yml
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/generate-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
git fetch origin gh-pages
git checkout gh-pages
git rm * -r --ignore-unmatch
git rm * -r -f --ignore-unmatch
git checkout HEAD -- .nojekyll
git checkout HEAD -- docs/
git add build/
Expand Down

0 comments on commit 73132f3

Please sign in to comment.