Skip to content

Commit 7e555c9

Browse files
authored
Merge pull request #26 from daedalist/nextjs-migration
Nextjs migration
2 parents 6e2ba07 + f23597d commit 7e555c9

File tree

19 files changed

+2927
-20936
lines changed

19 files changed

+2927
-20936
lines changed

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Runs on pushes to main branch
5+
push:
6+
branches: [ main ]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions for GitHub Pages deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '18'
34+
cache: 'npm'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Build Next.js app
40+
run: npm run build
41+
42+
- name: Upload build artifacts
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: ./build
46+
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
# production
1212
/build
1313

14+
# Next.js
15+
/.next/
16+
/out/
17+
next-env.d.ts
18+
1419
# misc
1520
.DS_Store
1621
.env.local
@@ -22,6 +27,18 @@ npm-debug.log*
2227
yarn-debug.log*
2328
yarn-error.log*
2429

30+
# Local testing directory for GitHub Pages simulation
31+
/test-deploy/
32+
33+
# Environment variables
34+
.env
35+
.env*.local
36+
37+
# Vercel deployment (if you ever deploy to Vercel)
38+
.vercel
39+
40+
# TypeScript
41+
*.tsbuildinfo
2542

2643
# Created by https://www.toptal.com/developers/gitignore/api/react,reactnative,macos,windows,linux
2744
# Edit at https://www.toptal.com/developers/gitignore?templates=react,reactnative,macos,windows,linux
@@ -394,4 +411,4 @@ $RECYCLE.BIN/
394411
# Windows shortcuts
395412
*.lnk
396413

397-
# End of https://www.toptal.com/developers/gitignore/api/react,reactnative,macos,windows,linux
414+
# End of https://www.toptal.com/developers/gitignore/api/react,reactnative,macos,windows,linux

next-env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
output: 'export',
4+
distDir: 'build',
5+
basePath: '/ghostbook', // Keep empty for GitHub Pages root deployment
6+
images: {
7+
unoptimized: true // Required for static export
8+
},
9+
trailingSlash: true
10+
}
11+
12+
module.exports = nextConfig

0 commit comments

Comments
 (0)