Skip to content

Commit

Permalink
add jb to toml and fix gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
andresfchamorro committed Dec 2, 2024
1 parent 9e3fc25 commit 6c1cfcb
Show file tree
Hide file tree
Showing 10 changed files with 927 additions and 20 deletions.
42 changes: 28 additions & 14 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
name: Publish to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"
- name: Dependencies
- name: Install Dependencies
working-directory: space2stats_api/src
run: |
if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi
- name: Build Jupyter Book
if [ -f pyproject.toml ]; then
pip install poetry && poetry install --with docs
fi
- name: Build Jupyter Book using Sphinx
run: |
jupyter-book build . --config docs/_config.yml --toc docs/_toc.yml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && job.status == 'success'
sphinx-build docs _build/html -b html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: job.status == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
enable_jekyll: false
path: "_build/html"

deploy-book:
needs: build-book
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ parts:
- caption: S2S Examples
numbered: False
chapters:
- file: notebooks/user-docs/space2stats_py_package_demo.ipynb
- file: notebooks/user-docs/space2stats_api_demo.ipynb
- file: notebooks/user-docs/space2stats_api_demo_R.Rmd
- file: user-docs/space2stats_py_package_demo.ipynb
- file: user-docs/space2stats_api_demo.ipynb
- file: user-docs/space2stats_api_demo_R.Rmd
- caption: S2S Python Documentation
numbered: False
chapters:
Expand Down
1 change: 0 additions & 1 deletion docs/notebooks

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
892 changes: 890 additions & 2 deletions space2stats_api/src/poetry.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions space2stats_api/src/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ pyarrow = "^17.0.0"
[tool.poetry.scripts]
space2stats-ingest = "space2stats_ingest.cli:app"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
jupyter-book = "^1.0.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 6c1cfcb

Please sign in to comment.