-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build docs in PR and clean workflows (#296)
- Loading branch information
Showing
4 changed files
with
51 additions
and
21 deletions.
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 |
---|---|---|
@@ -1,15 +1,22 @@ | ||
name: Publish docs | ||
name: Build the documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: [main] | ||
pull_request: | ||
on: | ||
workflow_run: | ||
workflows: ["Tests"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build-and-deploy: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Checkout the branch | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
|
@@ -19,15 +26,7 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
|
||
- name: Build docs | ||
- name: Build the documentation with Sphinx | ||
run: | | ||
pip install -r requirements-doc.txt | ||
sphinx-build -b html docs docs/build/html | ||
- name: Publish docs | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: docs/build/html | ||
CLEAN: true |
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,29 @@ | ||
name: Publish the documentation | ||
|
||
on: | ||
push: | ||
on: | ||
workflow_run: | ||
workflows: ["Build the documentation"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Checkout the branch | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
- name: Publish the documentation | ||
if: success() && github.ref == 'refs/heads/main' | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: docs/build/html | ||
CLEAN: true |
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
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