From 3ae4b68b1c3f1c3d1f841f0430311b7f33135d3d Mon Sep 17 00:00:00 2001 From: "Jeffrey (Dongkyu) Kim" Date: Thu, 18 Jan 2024 01:42:54 +0900 Subject: [PATCH] Make github action for sphinx docs (#26) * make sphinx.yml workflow and edit for github actions * add .md support for source_suffix --------- Co-authored-by: jeffrey --- .github/workflows/sphinx.yml | 25 +++++++++++++++++++++++++ dev_requirements.txt | 6 ------ docs/Makefile | 2 +- docs/requirements.txt | 6 ++++++ docs/source/conf.py | 4 ++++ 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/sphinx.yml create mode 100644 docs/requirements.txt diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml new file mode 100644 index 000000000..651e5f5a1 --- /dev/null +++ b/.github/workflows/sphinx.yml @@ -0,0 +1,25 @@ +name: Sphinx build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build HTML + uses: ammaraskar/sphinx-action@0.4 + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: html-docs + path: docs/build/html/ + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html diff --git a/dev_requirements.txt b/dev_requirements.txt index 1982d537f..53ee46186 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,11 +1,5 @@ pytest pytest-env -sphinx -furo twine build setuptools-scm -myst-parser -sphinx-inline-tabs -sphinx-copybutton -sphinx_design diff --git a/docs/Makefile b/docs/Makefile index d0c3cbf10..2c1aeba2f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,7 +4,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build +SPHINXBUILD += sphinx-build SOURCEDIR = source BUILDDIR = build diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..b84434c86 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,6 @@ +sphinx +furo +myst-parser +sphinx-inline-tabs +sphinx-copybutton +sphinx_design diff --git a/docs/source/conf.py b/docs/source/conf.py index 472b02123..f2a54e876 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,6 +28,10 @@ "sphinx_design", "sphinx_inline_tabs", ] +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} templates_path = ['_templates'] exclude_patterns = []