Skip to content

Commit

Permalink
DOC: add CI job to publish docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhaber committed Dec 28, 2024
1 parent 34a7d66 commit 6d124af
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy Jupyter Book to GitHub Pages

on:
push:
branches:["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install flit and dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install # Install the package itself, if needed
- name: Install Jupyter Book and ghp-import
run: |
pip install jupyter-book ghp-import # Install the Jupyter Book and deployment tool
- name: Build the Jupyter Book
run: jupyter-book build mybook/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./mybook/_build/html # Path to the build directory
publish_branch: gh-pages # The branch where the book will be deployed
user_name: 'Matt Haberland'
user_email: '[email protected]'
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
module = "MArray"
author = "Matt Haberland"
author-email = "[email protected]"

[tool.flit.dependencies]
jupyter-book = "^0.12" # Required for building the Jupyter Book
ghp-import = "^2.0" # Required for deployment

[project]
name = "marray"
authors = [{ name = "Matt Haberland", email = "[email protected]" }]
Expand Down

0 comments on commit 6d124af

Please sign in to comment.