From 68c4f1c0d3208017240df2340f38d0301c8edb9e Mon Sep 17 00:00:00 2001 From: supplyandcommand <42962106+supplyandcommand@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:31:47 +0100 Subject: [PATCH] Automatic deployment of mkdocs on pushes --- .github/workflows/documentation.yml | 34 +++++++++++++++++++++++++++++ pyproject.toml | 12 ++++------ 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..1d7241b --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,34 @@ +# creates the documentation on pushes it to the gh-pages branch +name: Documentation + +on: + pull_request: + branches: [main] + push: + branches: [main] + + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Dependencies + run: | + python -m pip install --upgrade pip + pip install turftopic[pyro-ppl,docs] + + - name: Build and Deploy + if: github.event_name == 'push' + run: mkdocs gh-deploy --force + + - name: Build + if: github.event_name == 'pull_request' + run: mkdocs build \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 47c53d8..8560719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,17 +18,13 @@ torch = "^2.1.0" scipy = "^1.10.0" rich = "^13.6.0" pyro-ppl = { version = "^1.8.0", optional = true } +mkdocs = { version = "^1.5.2", optional = true } +mkdocs-material = { version = "^9.5.12", optional = true } +mkdocstrings = { version = "^0.24.0", extras = ["python"], optional = true } [tool.poetry.extras] pyro-ppl = ["pyro-ppl"] - -[tool.poetry.group.docs] -optional = true - -[tool.poetry.group.docs.dependencies] -mkdocs = "^1.5.2" -mkdocs-material = "^9.5.12" -mkdocstrings = { version = "^0.24.0", extras = ["python"] } +docs = ["mkdocs", "mkdocs-material", "mkdocstrings"] [build-system] requires = ["poetry-core"]