Skip to content

Commit

Permalink
Merge pull request #128 from hyanwong/ruff
Browse files Browse the repository at this point in the history
Add workflow to generate docs
  • Loading branch information
hyanwong authored Jul 10, 2024
2 parents 2fccb46 + 6ed3b25 commit 130b64b
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Docs

on:
pull_request:
push:
branches: [main]
tags:
- '*'

env:
OWNER: hyanwong
REPO: giglib

jobs:
build-docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: true

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: actions/cache@v3
id: venv-cache
with:
path: venv
key: docs-venv-v1-${{ hashFiles('docs/requirements.txt') }}

- name: Create venv and install deps
if: steps.venv-cache.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r docs/requirements.txt
- name: Build Docs
run: |
. venv/bin/activate
cd docs
make
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html

deploy-docs:
needs: build-docs
if: github.ref == 'refs/heads/main'
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@v3
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
portion
networkx
matplotlib
six
tskit
jupyter-book
sphinx-issues
sphinx-argparse
sphinxcontrib-bibtex
humanize
tqdm
msprime
ipywidgets
pandas
sphinx-book-theme #Unpinned to allow easy updating.

0 comments on commit 130b64b

Please sign in to comment.