Skip to content

Commit 3beb75a

Browse files
committed
ci: add GitHub Pages deployment for docs
- Configure Next.js for static export with basePath - Add GitHub Actions workflow to build and deploy - Remove website/.npmrc (not needed for GitHub Pages) - Site will be available at https://lytics.github.io/dev-agent
1 parent f9780ed commit 3beb75a

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'website/**'
9+
- '.github/workflows/deploy-docs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: 'pages'
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
33+
- name: Install dependencies
34+
working-directory: website
35+
run: npm install
36+
37+
- name: Build
38+
working-directory: website
39+
run: npm run build
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: website/out
45+
46+
deploy:
47+
runs-on: ubuntu-latest
48+
needs: build
49+
permissions:
50+
pages: write
51+
id-token: write
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4
56+

website/.npmrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

website/next.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ const withNextra = nextra({
66

77
export default withNextra({
88
reactStrictMode: true,
9+
output: 'export',
10+
images: {
11+
unoptimized: true, // Required for static export
12+
},
13+
basePath: '/dev-agent', // GitHub Pages serves from /repo-name
914
});

0 commit comments

Comments
 (0)