Skip to content

Commit dd932ca

Browse files
committed
ci: deploy to github pages via actions
- add deploy workflow building static export with pnpm - enable next static export in next.config.ts - mark robots and sitemap as force-static for export compatibility
1 parent 063e470 commit dd932ca

4 files changed

Lines changed: 60 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
version: 10
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: pnpm
31+
32+
- run: pnpm install --frozen-lockfile
33+
34+
- run: pnpm build
35+
env:
36+
NEXT_TELEMETRY_DISABLED: "1"
37+
38+
- uses: actions/configure-pages@v5
39+
40+
- run: touch out/.nojekyll
41+
42+
- uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: out
45+
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- id: deployment
54+
uses: actions/deploy-pages@v4

app/robots.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { MetadataRoute } from "next";
22

3+
export const dynamic = "force-static";
4+
35
export default function robots(): MetadataRoute.Robots {
46
return {
57
rules: [

app/sitemap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { MetadataRoute } from "next";
22

3+
export const dynamic = "force-static";
4+
35
export default function sitemap(): MetadataRoute.Sitemap {
46
const base = "https://firstfluke.com";
57
return [

next.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
output: "export",
5+
images: { unoptimized: true },
56
};
67

78
export default nextConfig;

0 commit comments

Comments
 (0)