Skip to content

Commit 45cca6f

Browse files
authored
chore: fix documentation generation (#3)
1 parent 7825011 commit 45cca6f

File tree

6 files changed

+633
-19
lines changed

6 files changed

+633
-19
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,33 @@ on:
88
jobs:
99
docs:
1010
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: ./docs
1114
steps:
1215
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v4
14-
- name: Install dependencies
15-
run: pip install sphinx
16-
- name: Sphinx build
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.8
20+
- name: Install poetry
21+
run: |
22+
pip install poetry
23+
poetry --version
24+
- name: Install dependencies and library
25+
run: poetry install --no-root
26+
- name: Generate documentation sources
1727
run: |
18-
sphinx-apidoc -o docs scaleway
19-
sphinx-build -b html docs _build
20-
- name: Deploy
28+
poetry run sphinx-apidoc -f -o ./source ../scaleway-core
29+
poetry run sphinx-apidoc -f -o ./source ../scaleway
30+
poetry run sphinx-apidoc -f -o ./source ../scaleway-async
31+
- name: Generate documentation
32+
run: poetry run sphinx-build -b html ./ ./_build
33+
- name: Deploy to GitHub Pages
2134
uses: peaceiris/actions-gh-pages@v3
2235
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
2336
with:
2437
publish_branch: docs
2538
github_token: ${{ secrets.GITHUB_TOKEN }}
26-
publish_dir: _build/
39+
publish_dir: ./docs/_build
2740
force_orphan: true

.github/workflows/pr.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ on:
44
types: ["opened", "edited", "reopened", "synchronize"]
55

66
jobs:
7-
commitlint:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v3
11-
with:
12-
fetch-depth: 0
13-
- uses: wagoid/commitlint-github-action@v3
14-
157
tests:
168
runs-on: ubuntu-latest
179
strategy:

docs/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
# -- General configuration ---------------------------------------------------
1818
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1919

20-
extensions = ["sphinx.ext.autodoc"]
20+
extensions = [
21+
"sphinx.ext.autodoc",
22+
"sphinx.ext.autosummary",
23+
"sphinx_rtd_theme",
24+
]
25+
autosummary_generate = True
2126

2227
templates_path = ["_templates"]
2328
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
@@ -26,7 +31,7 @@
2631
# -- Options for HTML output -------------------------------------------------
2732
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2833

29-
html_theme = "alabaster"
34+
html_theme = "sphinx_rtd_theme"
3035
html_static_path = ["_static"]
3136

32-
sys.path.insert(0, os.path.abspath('..'))
37+
sys.path.insert(0, os.path.abspath(".."))

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Welcome to Scaleway Python SDK's documentation!
1010
:maxdepth: 2
1111
:caption: Contents:
1212

13+
scaleway-core
14+
scaleway
15+
scaleway-async
16+
1317

1418

1519
Indices and tables

0 commit comments

Comments
 (0)