-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 2.22 KB
/
Copy pathdeploy.yml
File metadata and controls
79 lines (65 loc) · 2.22 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
name: Deploy to GitHub Pages
# Triggers on every push to main, plus manual dispatch from the Actions tab.
on:
push:
branches: [main]
workflow_dispatch:
# Only one deployment at a time — cancel any in-flight run when a new push lands.
concurrency:
group: pages
cancel-in-progress: true
# GitHub Pages deployments need these tokens.
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build site
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# v5 runs on Node 24 (v4 used Node 20, deprecated Sep 2025).
- name: Checkout
uses: actions/checkout@v5
# No `version` input — pnpm/action-setup@v4 reads the `packageManager`
# field from package.json (pnpm@11.15.1). Pinning a different version
# here caused ERR_PNPM_BAD_PM_VERSION in earlier runs.
- name: Install pnpm
uses: pnpm/action-setup@v4
# Node 22 matches the `engines.node` requirement in package.json (>=22.12).
# v5 runs on Node 24 (v4 used Node 20, deprecated Sep 2025).
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "22"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Quality gates — must pass before the site is built and deployed.
# Both checks are green locally; keeping them in CI catches regressions.
- name: Lint
run: pnpm run lint
- name: Check formatting
run: pnpm run format:check
# Build script: astro check (type-check) → astro build (SSG) →
# pagefind (search index) → copy pagefind to public/ (for dev search).
# The copy step uses node fs.cpSync which is cross-platform (works on
# both Windows local dev and Ubuntu CI).
- name: Build
run: pnpm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to Pages
id: deployment
uses: actions/deploy-pages@v4