1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Deploy docs to GitHub Pages
# Builds the Zensical site (docs/ + the shared molcrafts theme) and publishes it
# to https://molcrafts.github.io/molpack/. The docs are hand-written Markdown —
# the four rustdoc chapters are shared via `#[doc = include_str!(...)]` but that
# only matters to `cargo doc`; Zensical just reads the .md files — so this job
# needs neither the Rust toolchain, molrs, nor a maturin build. It installs the
# `doc` dependency group from python/pyproject.toml (zensical + the theme, both
# on PyPI) and nothing else.
#
# One-time repo setup: Settings -> Pages -> Build and deployment -> Source =
# "GitHub Actions" (this workflow provides the artifact + deployment).
on:
push:
branches:
paths:
- "docs/**"
- "zensical.toml"
- "python/pyproject.toml"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Serialize deployments; let an in-flight publish finish rather than cancelling.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
# Canonical repo only — forks have no Pages target, so skip there (matches
# the fork -> PR workflow: origin = Roy-Kid, upstream = MolCrafts).
if: github.repository == 'MolCrafts/molpack'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v6
- name: Build site
# Install the doc group into a venv under python/ (mirrors the ci.yml
# `uv pip install --group ...` pattern), then build from the repo root
# where zensical.toml lives — it writes the site to ./site.
run: |
cd python
uv venv
source .venv/bin/activate
uv pip install --group doc
cd ..
zensical build
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
if: github.repository == 'MolCrafts/molpack'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4