Skip to content

Commit

Permalink
Merge pull request #7 from ihmeuw-msca/publish-docs
Browse files Browse the repository at this point in the history
Changes learned while working on docs for OneMod
  • Loading branch information
zhengp0 authored Sep 13, 2024
2 parents 4c047bb + ba97548 commit 080c350
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }}

docs:
environment:
name: github-pages
runs-on: ubuntu-latest
permissions:
pages: write
Expand All @@ -41,10 +43,13 @@ jobs:
with:
python-version: "3.12"
- name: Install dependencies
run: python -m pip install .[docs] --upgrade pip
run: |
python -m pip install .[docs] --upgrade pip
- name: Generate API docs & Build sphinx documentation
run: |
git fetch --tags
git checkout main
git pull
cd docs
python build.py
cd ..
Expand All @@ -53,7 +58,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/pages'
path: './docs-out/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion docs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@


def build_doc(version: str) -> None:
print(f"Build _{version}_")
run(f"git checkout v{version}")
run("git checkout main -- conf.py")
run("git checkout main -- meta.toml")

run("make html")
run("sphinx-build -M html . _build")
run(f"mv _build/html pages/{version}")
run("rm -rf _build")
run("git checkout main")
Expand Down

0 comments on commit 080c350

Please sign in to comment.