Skip to content

Commit

Permalink
let sphinx.yml operate on a non-default docs location (#30)
Browse files Browse the repository at this point in the history
* introduce new input `project-root`
* set artifact name to `project-root` value if it is not `.`.
  otherwise use repo's name as usual.
  • Loading branch information
2bndy5 authored Aug 14, 2024
1 parent 02492e0 commit c5cd4d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
type: string
default: docs/_build/html
description: The docs path name
project-root:
required: false
type: string
default: '.'
description: The root directory of conrtaining the docs folder

jobs:
sphinx-deploy:
Expand All @@ -17,16 +22,19 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install dependencies
working-directory: ${{ inputs.project-root }}
run: pip install -r docs/requirements.txt -e .

- name: Build docs
working-directory: ${{ inputs.project-root }}
run: sphinx-build docs ${{ inputs.path-to-doc }}

- name: Upload docs build as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}_docs
name: ${{ inputs.project-root == '.' && github.event.repository.name || inputs.project-root }}_docs
path: ${{ github.workspace }}/${{ inputs.path-to-doc }}

- name: Upload to github pages
Expand Down

0 comments on commit c5cd4d9

Please sign in to comment.