Skip to content

Commit c4273e7

Browse files
committed
deploy: to cloudflare
1 parent fa7b547 commit c4273e7

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed

front-end/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

front-end/DEPLOY.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Cloudflare Pages Deployment Guide
2+
3+
## Quick Deploy
4+
5+
### Option 1: Direct GitHub Integration (Recommended)
6+
7+
1. Push your code to GitHub
8+
2. Go to [Cloudflare Pages](https://pages.cloudflare.com/)
9+
3. Click "Create a project" → "Connect to Git"
10+
4. Select your repository
11+
5. Configure build settings:
12+
- Framework preset: `Next.js (Static HTML Export)`
13+
- Build command: `npm run build`
14+
- Build output directory: `out`
15+
- Root directory: `front-end`
16+
- Node version: `20`
17+
18+
### Option 2: Manual Deploy with Wrangler CLI
19+
20+
1. Install Wrangler:
21+
```bash
22+
npm install -g wrangler
23+
```
24+
25+
2. Build the project:
26+
```bash
27+
cd front-end
28+
npm install
29+
npm run build
30+
```
31+
32+
3. Deploy to Cloudflare Pages:
33+
```bash
34+
npx wrangler pages deploy out --project-name=gpt-5-examples
35+
```
36+
37+
## Environment Variables
38+
39+
No environment variables required for basic deployment.
40+
41+
## Build Settings
42+
43+
- **Framework**: Next.js (Static Export)
44+
- **Node Version**: 20
45+
- **Build Command**: `npm run build`
46+
- **Output Directory**: `out`
47+
- **Install Command**: `npm install`
48+
49+
## Features Included
50+
51+
- ✅ Static site generation
52+
- ✅ Search functionality
53+
- ✅ Responsive design
54+
- ✅ All demo apps included
55+
- ✅ Auto-deploy on push
56+
57+
## Troubleshooting
58+
59+
### Build Errors
60+
61+
If you encounter lightningcss errors:
62+
```bash
63+
npm install lightningcss --save-dev
64+
```
65+
66+
### Large Build Size
67+
68+
The build includes 50+ demo HTML files. This is expected.
69+
70+
## Preview Deployments
71+
72+
Every pull request automatically gets a preview URL.
73+
74+
## Custom Domain
75+
76+
In Cloudflare Pages dashboard:
77+
1. Go to your project
78+
2. Click "Custom domains"
79+
3. Add your domain
80+
4. Follow DNS configuration steps

front-end/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front-end/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"@types/react-dom": "^19",
6767
"eslint": "^9",
6868
"eslint-config-next": "15.4.6",
69+
"lightningcss": "^1.30.1",
6970
"tailwindcss": "^4",
7071
"tw-animate-css": "^1.3.6",
7172
"typescript": "^5"

front-end/wrangler.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = "gpt-5-examples"
2+
compatibility_date = "2024-01-01"
3+
4+
[build]
5+
command = "npm run build"
6+
directory = "out"

0 commit comments

Comments
 (0)