Skip to content

Commit a236a6c

Browse files
authored
Merge pull request #108 from kayjan/add-rtd-integration
Added: GitHub integration with RTD for docs
2 parents 6781213 + d63334d commit a236a6c

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/docs.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ on:
88
- completed
99

1010
jobs:
11-
docs:
11+
setup:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check if upstream workflow failed
1515
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
1616
run: exit 1
17+
docs:
18+
runs-on: ubuntu-latest
19+
steps:
1720
- uses: actions/checkout@v2
1821
- uses: actions/setup-python@v2
1922
- name: Install dependencies
@@ -22,11 +25,22 @@ jobs:
2225
- name: Sphinx build
2326
run: |
2427
sphinx-build docs/source docs/build
25-
- name: Deploy
28+
- name: Deploy to GH Pages
2629
uses: peaceiris/actions-gh-pages@v3
2730
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
2831
with:
2932
publish_branch: gh-pages
3033
github_token: ${{ secrets.GITHUB_TOKEN }}
3134
publish_dir: docs/build/
3235
force_orphan: true
36+
- name: Deploy to RTD
37+
- uses: actions/upload-artifact@v2
38+
with:
39+
name: docs-${{ github.sha }}
40+
path: docs/build/html
41+
- name: Trigger RTDs build
42+
uses: dfm/rtds-action@v1
43+
with:
44+
webhook_url: ${{ secrets.RTD_URL }}
45+
webhook_token: ${{ secrets.RTD_TOKEN }}
46+
commit_ref: ${{ github.ref }}

docs/source/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"myst_parser",
2929
"sphinxemoji.sphinxemoji",
3030
"sphinx.ext.mathjax",
31+
"rtds_action",
3132
]
3233
autodoc_default_options = {"autosummary": True}
3334
sphinxemoji_style = "twemoji"
@@ -37,6 +38,13 @@
3738

3839
language = "Python"
3940

41+
# GitHub Action Integration
42+
rtds_action_github_repo = "kayjan/bigtree"
43+
rtds_action_path = "../build/html"
44+
rtds_action_artifact_prefix = "docs-"
45+
rtds_action_github_token = os.environ["GH_TOKEN"]
46+
rtds_action_error_if_missing = True
47+
4048
# -- Options for HTML output -------------------------------------------------
4149
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4250

0 commit comments

Comments
 (0)