lisphilar / covid19-sir

CovsirPhy: Python library for COVID-19 analysis with phase-dependent SIR-derived ODE models.
https://lisphilar.github.io/covid19-sir/
Apache License 2.0
110 stars 44 forks source link

[Revise] GitHub pages deployment with GitHub Actions #1184

Closed lisphilar closed 2 years ago

lisphilar commented 2 years ago

Summary of request

Documentation (GitHub Pages) is updated manually using Semaphore CI with the following commands. This is supposed to be automated and visible for users and developers.

git config user.email "XXXXXXXXXXXXXX"
git config user.name "XXXXXXXXX"
git pull "https://${GH_TOKEN}@github.com/lisphilar/covid19-sir.git"
sem-version python 3.9
pip install --upgrade pip Sphinx sphinx-rtd-theme sphinxcontrib-seqdiag nbsphinx sphinx_copybutton recommonmark sphinx_markdown_tables ipykernel ipywidgets docutils==0.16 sphinx-favicon
pip install .
cp --force example/*.ipynb docs/
cp --force .github/CODE_OF_CONDUCT.md docs/CODE_OF_CONDUCT.md
cp --force .github/CONTRIBUTING.md docs/CONTRIBUTING.md
cp --force SECURITY.md docs/SECURITY.md
sudo apt install pandoc -y
pandoc -f commonmark -o docs/README.rst README.md --to rst
sphinx-apidoc -o docs covsirphy -fMT
cd docs; make html; cp -a _build/html/. ../docs
git add .
git commit -m "Deploy to GitHub Pages with semaphore"
git push "https://${GH_TOKEN}@github.com/lisphilar/covid19-sir.git"

The current Version

CovsirPhy version I used: 2.26.1

lisphilar commented 2 years ago

To fix the following error when reading sources, sphinx_markdown_tables will be removed from docs dependencies.

Extension error (sphinx_markdown_tables):
Handler <function process_tables at 0x7f4b46757ca0> for event 'source-read' threw an exception (exception: __init__() takes 2 positional arguments but 3 were given)
lisphilar commented 2 years ago

Replace recommonmark with myst-parser because recommonmark was depreated. https://github.com/readthedocs/recommonmark

lisphilar commented 2 years ago

Deployment completed.