-
Notifications
You must be signed in to change notification settings - Fork 66
75 lines (64 loc) · 1.98 KB
/
deploy-docs.yaml
File metadata and controls
75 lines (64 loc) · 1.98 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
name: Deploy Docs to GitHub Pages
on:
push:
branches:
- main
- feat/new-docs
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yaml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment; cancel in-progress runs.
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
# pnpm via corepack (bundled with Node) — avoids third-party setup actions
# that are blocked by the org's allowed-actions policy.
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@10.16.1 --activate
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build static site (Fumadocs)
run: pnpm build:static
env:
# GitHub Pages project site is served from /<repo>. Without this base
# path, assets and routes 404 under the sub-path. (The pitfall.)
NEXT_PUBLIC_BASE_PATH: /${{ github.event.repository.name }}
# Optional: external Ask-AI endpoint (e.g. a VeFaaS function).
NEXT_PUBLIC_AI_CHAT_URL: ${{ vars.AI_CHAT_URL }}
- name: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: docs/out
deploy:
needs: build
runs-on: ubuntu-latest
# The github-pages environment restricts deployments to the default branch.
# Branches/PRs run the build job above to validate; deploy happens on main.
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4