Skip to content

Commit

Permalink
Add docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
adjavon committed Nov 27, 2024
1 parent 630ec7a commit 0603eaa
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 13 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Docs to GitHub Pages

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

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true

- name: Install package and dependencies
run: |
python -m pip install -e .[docs]
- name: Build documentation
run: sphinx-build docs/source docs/build/html -W -b html

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
retention-days: 90

deploy:
if: github.ref == 'refs/heads/main'
needs: build
# Deploy to the github-pages environment
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
26 changes: 13 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ name = "quac"
description = "Quantitative Attribution with Counterfactuals"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
]
classifiers = ["Programming Language :: Python :: 3"]
keywords = []
license = { text = "BSD 3-Clause License" }
authors = [
{ email = "[email protected]", name = "Funke Lab" },
]
authors = [{ email = "[email protected]", name = "Funke Lab" }]
dynamic = ["version"]
dependencies = [
"captum",
Expand All @@ -26,16 +22,20 @@ dependencies = [
"opencv-python",
"pydantic",
"scipy",
"scikit-learn"
"scikit-learn",
]

[project.optional-dependencies]
dev = [
'pytest',
'black',
'mypy',
'pdoc',
'pre-commit',
dev = ['pytest', 'black', 'mypy', 'pdoc', 'pre-commit']
docs = [
"ipykernel",
"jupyter_sphinx",
"sphinx_autodoc_typehints",
"sphinx_rtd_theme>1.0",
"sphinx_togglebutton",
"sphinxcontrib_jquery",
"sphinx>6",
"tomli",
]

[project.urls]
Expand Down

0 comments on commit 0603eaa

Please sign in to comment.