Repository navigation
108 lines (97 loc) · 3.71 KB
/
Copy pathwebsite.yml
File metadata and controls
108 lines (97 loc) · 3.71 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Deploy website (fast)
# Fast path: builds and deploys ONLY the interactive website (no Lean build),
# so https://statlean.github.io/website/ goes live in minutes. The doc-gen4
# docs are pulled from the shared cache that the full `deploy.yml` workflow
# populates; if that cache is empty (docs not built yet) the website still
# deploys and /docs/ becomes available after the first full build.
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '.github/workflows/website.yml'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout source repository (StatLean/Stat-Lean)
uses: actions/checkout@v4
with:
repository: StatLean/Stat-Lean
ref: main
fetch-depth: 1
path: src
- name: Restore docs cache (if a full build has run)
uses: actions/cache@v4
with:
path: site/docs
key: site-docs-${{ hashFiles('src/lean-toolchain', 'src/lakefile.lean', 'src/lake-manifest.json', 'src/StatLean.lean', 'src/StatLean/**/*.lean') }}
restore-keys: site-docs-
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: src/website/package-lock.json
- name: Build the website
working-directory: src/website
run: |
npm ci
npm run build
- name: Assemble GitHub Pages site
run: |
mkdir -p site/docs site/website
cp -r src/website/dist/* site/website/
touch site/.nojekyll
cat > site/index.html <<'EOF'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Asymptotic Statistical Theory in Lean 4</title>
<meta http-equiv="refresh" content="0; url=./website/">
<link rel="canonical" href="./website/">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 46rem; margin: 4rem auto; padding: 0 1.25rem; line-height: 1.6; color: #1b1b1b; }
h1 { font-size: 1.9rem; margin-bottom: 0.25rem; }
a { color: #b07414; }
.btn { display: inline-block; margin-top: 1rem; margin-right: 0.5rem; padding: 0.6rem 1.1rem; background: #1b1b1b; color: #fff; border-radius: 999px; text-decoration: none; }
.btn.alt { background: transparent; color: #1b1b1b; border: 1px solid #ccc; }
.muted { color: #555; }
</style>
</head>
<body>
<h1>Asymptotic Statistical Theory in Lean 4</h1>
<p class="muted">Redirecting to the Stat-Lean website…</p>
<p>
<a class="btn" href="./website/">Open the website →</a>
<a class="btn alt" href="./docs/">API documentation</a>
</p>
<p class="muted">Source:
<a href="https://github.com/StatLean/Stat-Lean">github.com/StatLean/Stat-Lean</a></p>
</body>
</html>
EOF
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4