From c5cd4d9902651776e21a142847c4e854f9342b2f Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 13 Aug 2024 21:57:54 -0700 Subject: [PATCH] let sphinx.yml operate on a non-default docs location (#30) * introduce new input `project-root` * set artifact name to `project-root` value if it is not `.`. otherwise use repo's name as usual. --- .github/workflows/sphinx.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index e50d156..4a92d6a 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -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: @@ -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