This repository was archived by the owner on Aug 8, 2026. It is now read-only.
Repository navigation
82 lines (67 loc) · 2.12 KB
/
Copy pathdocs.yml
File metadata and controls
82 lines (67 loc) · 2.12 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build and Deploy Docs
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# --- mdBook (guide) ---
- name: Install mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'
- name: Rewrite API links for deployment
run: |
# doc-gen4 output lives at api/ relative to the mdBook root.
# Rewrite ../Hale/ and ../../Hale/ links to relative api/Hale/ paths.
# Order matters: longest match first to avoid partial replacement.
find docs -name '*.md' -exec sed -i \
-e 's|\.\./\.\./Hale/|../api/Hale/|g' \
-e 's|\.\./Hale/|api/Hale/|g' \
{} +
- name: Build mdBook
run: mdbook build docs
# --- doc-gen4 (API reference) ---
- name: Install OpenSSL
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- uses: leanprover/lean-action@v1
- name: Generate doc-gen4 API docs
run: lake build Hale:docs
# --- Merge into single site ---
- name: Assemble site
run: |
mkdir -p _site
# Guide at root (landing page)
# mdBook 0.5+ outputs directly to build-dir (no html/ subdir)
cp -r .lake/build/guide/* _site/
# API reference at /api/
mkdir -p _site/api
cp -r .lake/build/doc/* _site/api/
- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
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