Skip to content

Commit 256fe12

Browse files
committed
Refactor next.config.ts for custom domain setup, removing basePath and assetPrefix. Update package.json to add production build and serve scripts. Clean up deploy.yml by removing unnecessary CNAME configuration.
1 parent 25cc2bc commit 256fe12

File tree

4 files changed

+70
-6
lines changed

4 files changed

+70
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ jobs:
3333
if: github.ref == 'refs/heads/main'
3434
with:
3535
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./out
37-
cname: open-superintelligence-lab.github.io
36+
publish_dir: ./out

DEPLOYMENT.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# GitHub Pages Deployment Guide
2+
3+
This Next.js app is configured for deployment to GitHub Pages at `https://open-superintelligence-lab.github.io/Open-Superintelligence-Lab.github.io/`.
4+
5+
## ✅ What's Fixed
6+
7+
1. **Base Path Configuration**: Updated `next.config.ts` with correct `basePath` and `assetPrefix`
8+
2. **Tailwind CSS**: Verified content paths include `./app/**/*.{js,ts,jsx,tsx,mdx}`
9+
3. **GitHub Actions**: Created automatic deployment workflow
10+
4. **Build Process**: Fixed Turbopack issues and PostCSS configuration
11+
12+
## 🚀 Deployment Methods
13+
14+
### Method 1: Automatic (Recommended)
15+
The GitHub Actions workflow will automatically deploy when you push to the `main` branch:
16+
17+
1. Push your changes to `main`
18+
2. The workflow will build and deploy automatically
19+
3. Your site will be available at: `https://open-superintelligence-lab.github.io/Open-Superintelligence-Lab.github.io/`
20+
21+
### Method 2: Manual Deployment
22+
```bash
23+
# Build for production
24+
npm run build:prod
25+
26+
# Serve locally to test
27+
npm run serve:out
28+
29+
# The built files are in the `out/` directory
30+
# Push the contents of `out/` to your `gh-pages` branch
31+
```
32+
33+
## 🔧 Local Testing
34+
35+
To test the production build locally:
36+
37+
```bash
38+
# Build with production settings
39+
npm run build:prod
40+
41+
# Serve the built files
42+
npm run serve:out
43+
```
44+
45+
## 📁 Key Files
46+
47+
- `next.config.ts` - Contains basePath and assetPrefix configuration
48+
- `.github/workflows/deploy.yml` - GitHub Actions deployment workflow
49+
- `tailwind.config.js` - Tailwind CSS configuration with correct content paths
50+
- `postcss.config.mjs` - PostCSS configuration for CSS processing
51+
52+
## 🐛 Troubleshooting
53+
54+
If CSS is missing on GitHub Pages:
55+
56+
1. ✅ Check `basePath` matches your repo name exactly
57+
2. ✅ Verify `assetPrefix` has trailing slash
58+
3. ✅ Ensure Tailwind content paths include all your component directories
59+
4. ✅ Make sure you're deploying the `out/` folder, not `.next/`
60+
61+
## 🌐 Your Site URL
62+
63+
Once deployed, your site will be available at:
64+
`https://open-superintelligence-lab.github.io/Open-Superintelligence-Lab.github.io/`

next.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ const nextConfig: NextConfig = {
66
images: {
77
unoptimized: true
88
},
9-
// GitHub Pages configuration
10-
basePath: process.env.NODE_ENV === 'production' ? '/Open-Superintelligence-Lab.github.io' : '',
11-
assetPrefix: process.env.NODE_ENV === 'production' ? '/Open-Superintelligence-Lab.github.io/' : '',
9+
// Custom domain configuration (opensuperintelligencelab.com)
10+
// No basePath needed for custom domain
1211
distDir: 'out',
1312
};
1413

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "eslint",
10-
"export": "next build && next export"
10+
"export": "next build && next export",
11+
"build:prod": "NODE_ENV=production npm run build",
12+
"serve:out": "npx serve out"
1113
},
1214
"dependencies": {
1315
"react": "19.1.0",

0 commit comments

Comments
 (0)