Skip to content

Commit c91fb31

Browse files
committed
Configure Next.js for static export and add GitHub Pages deployment to CI workflow.
1 parent 1d33370 commit c91fb31

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,41 @@ jobs:
3333
- name: Build
3434
run: npm run build
3535

36+
deploy:
37+
runs-on: ubuntu-latest
38+
needs: lint-build
39+
if: github.ref == 'refs/heads/main'
40+
permissions:
41+
pages: write
42+
id-token: write
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
- name: Setup Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 20
54+
cache: npm
55+
56+
- name: Install
57+
run: npm ci
58+
59+
- name: Build
60+
run: npm run build
61+
62+
- name: Setup Pages
63+
uses: actions/configure-pages@v4
64+
65+
- name: Upload artifact
66+
uses: actions/upload-pages-artifact@v3
67+
with:
68+
path: ./out
69+
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4
73+

next.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
4+
output: 'export',
5+
trailingSlash: true,
46
async headers() {
57
const csp = [
68
"default-src 'self'",

0 commit comments

Comments
 (0)