diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..9460e1e9 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,31 @@ +name: Build documentation + +on: + push: + pull_request: + types: [opened, synchronize] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_dev.txt + pip install -e . + - name: Build documentation + run: | + python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs docs/_build/html -n -W + - uses: actions/upload-artifact@v2 + name: Upload docs as artifact + with: + name: docs-html + path: './docs/_build/html' + if-no-files-found: error diff --git a/docs/conf.py b/docs/conf.py index 68450c2e..5c299e15 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,4 +58,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = [] diff --git a/requirements_dev.txt b/requirements_dev.txt index 13290ebe..fb38e977 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -9,3 +9,5 @@ requests==2.22.0 responses==0.10.12 webob strict-rfc3339==0.7 +sphinx==4.0.2 +sphinx-rtd-theme==0.5.2