Skip to content

Dev

Dev #42

Workflow file for this run

name: Deploy Documentation
on:
workflow_run:
workflows: ["Version Bump"]
types:
- completed
pull_request:
branches:
- master
paths:
- packages/python/lactation/**
permissions:
contents: read
pages: write
id-token: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_run' && 'master' || '' }}
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python 3.12 (via uv)
run: uv python install 3.12
- name: Install project with uv
working-directory: packages/python/lactation
run: uv sync
- name: Generate documentation with pdoc
working-directory: packages/python/lactation
run: |
uv run pdoc lactationcurve \
--output-dir site \
--docformat google \
--logo https://raw.githubusercontent.com/Bovi-analytics/lactation_curve_core/master/packages/python/lactation/site/logo.png \
--logo-link https://bovi-analytics.org \
--footer-text "Lactation Curve Package – Bovi-Analytics lab" \
--template-directory templates
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/python/lactation/site
deploy:
if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'
needs: build-docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4