diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fd5b43c..6e47ba1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -22,8 +22,6 @@ - [ ] My code follows the code style of this project. (`make clean`) -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. (`make html`) - [ ] I have incremented the version number in the `pyproject.toml` file. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. (`make tests`) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..2b2b3be --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,56 @@ +name: Build and Deploy Docs +on: + push: + branches: [ "main" ] + paths: + - 'doc_source/**' + - 'src/ect/**' + +jobs: + docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: "pyproject.toml" + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y pandoc + + - name: Create venv and install dependencies + run: | + uv venv + source .venv/bin/activate + uv pip install -e . + uv pip install sphinx sphinx-rtd-theme nbsphinx autopep8 myst-parser + + - name: Build documentation + run: | + source .venv/bin/activate + make html + + - name: Configure Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Commit and push if changed + run: | + if [[ -n "$(git status --porcelain docs/)" ]]; then + git add docs/ + git commit -m "docs: auto-generate documentation" + git push origin HEAD:main + else + echo "No changes to commit" + fi \ No newline at end of file diff --git a/Makefile b/Makefile index 8ed1292..d941e22 100644 --- a/Makefile +++ b/Makefile @@ -23,12 +23,10 @@ release: python setup.py sdist bdist_wheel html: - # Running sphinx-build to build html files in build folder. - rm -r docs + # Running sphinx-build to build html files in docs folder + rm -rf docs mkdir docs - sphinx-build -M html doc_source docs - rsync -a docs/html/ docs/ - rm -r docs/html + sphinx-build -b html doc_source docs benchmark: python benchmarks/run_benchmarks.py diff --git a/pyproject.toml b/pyproject.toml index b5aa6dc..3b63f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ect" -version = "1.0.0" +version = "1.0.1" authors = [ { name="Liz Munch", email="muncheli@msu.edu" }, ]