Skip to content

Commit d9ae574

Browse files
committed
Merge branch 'main' of https://github.com/Mahdirnj/comp-gen
2 parents 893ecdf + 5b46ce3 commit d9ae574

File tree

1 file changed

+0
-126
lines changed

1 file changed

+0
-126
lines changed

README.md

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -72,132 +72,6 @@ Modify these files to customize behavior:
7272
## License
7373
MIT License (see LICENSE.txt)
7474

75-
---
76-
77-
## Deploy to GitHub Pages with CI/CD
78-
79-
You can deploy this Next.js App Router project to GitHub Pages using GitHub Actions. GitHub Pages serves static files, so we’ll use Next’s static export.
80-
81-
### 1) Prepare the repository
82-
1. Create a GitHub repo (e.g., comp-gen).
83-
2. Add the remote and push your local project:
84-
- git init
85-
- git add .
86-
- git commit -m "Initial commit"
87-
- git branch -M main
88-
- git remote add origin https://github.com/<your-username>/comp-gen.git
89-
- git push -u origin main
90-
91-
### 2) Configure Next.js for static export
92-
Add the following to next.config.ts:
93-
94-
```ts
95-
import type { NextConfig } from "next";
96-
97-
const nextConfig: NextConfig = {
98-
// Produces a static export in the `out/` folder at build time
99-
output: "export",
100-
// For Project Pages (https://<user>.github.io/<repo>/), set basePath to "/<repo>"
101-
// Leave empty for User/Org Pages (https://<user>.github.io)
102-
// basePath: process.env.NEXT_PUBLIC_BASE_PATH || "",
103-
// assetPrefix helps static assets resolve under the basePath
104-
// assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH
105-
// ? `${process.env.NEXT_PUBLIC_BASE_PATH}/`
106-
// : undefined,
107-
};
108-
109-
export default nextConfig;
110-
```
111-
112-
Notes:
113-
- If you deploy to Project Pages (repo site at https://<user>.github.io/<repo>), you must set basePath to "/<repo>" (and optionally assetPrefix) for client-side routing and assets to work.
114-
- If you deploy to User/Org Pages (https://<user>.github.io), leave basePath empty.
115-
116-
### 3) Add a GitHub Actions workflow
117-
Create .github/workflows/deploy.yml in your repo with:
118-
119-
```yaml
120-
name: Deploy to GitHub Pages
121-
122-
on:
123-
push:
124-
branches: [ main ]
125-
workflow_dispatch:
126-
127-
permissions:
128-
contents: read
129-
pages: write
130-
id-token: write
131-
132-
concurrency:
133-
group: pages
134-
cancel-in-progress: true
135-
136-
jobs:
137-
build:
138-
runs-on: ubuntu-latest
139-
steps:
140-
- name: Checkout
141-
uses: actions/checkout@v4
142-
143-
- name: Setup Node
144-
uses: actions/setup-node@v4
145-
with:
146-
node-version: "20"
147-
cache: npm
148-
149-
- name: Install dependencies
150-
run: npm ci
151-
152-
- name: Build (Turbopack)
153-
run: npm run build
154-
155-
- name: Static export
156-
run: npx next export
157-
158-
- name: Upload Pages artifact
159-
uses: actions/upload-pages-artifact@v3
160-
with:
161-
path: out
162-
163-
deploy:
164-
runs-on: ubuntu-latest
165-
needs: build
166-
environment:
167-
name: github-pages
168-
url: ${{ steps.deployment.outputs.page_url }}
169-
steps:
170-
- name: Deploy to GitHub Pages
171-
id: deployment
172-
uses: actions/deploy-pages@v4
173-
```
174-
175-
Then, in your GitHub repository:
176-
- Settings → Pages → Source: “Deploy from a branch” or “GitHub Actions” → select GitHub Actions.
177-
178-
Optional: For Project Pages, set the base path via environment variable
179-
- In the workflow, add:
180-
```yaml
181-
env:
182-
NEXT_PUBLIC_BASE_PATH: "/<repo>"
183-
```
184-
and uncomment basePath/assetPrefix in next.config.ts.
185-
186-
### 4) Test locally (optional)
187-
- Build and export:
188-
- npm run build
189-
- npx next export
190-
- Serve the static site locally:
191-
- npx serve out -p 5000
192-
- Open http://localhost:5000 (or http://localhost:5000/<repo> if using basePath).
193-
194-
### 5) Limitations and tips
195-
- GitHub Pages is static-only. Avoid server-only features (API routes, dynamic SSR) when using output: "export".
196-
- This project primarily uses client components and should export cleanly.
197-
- If you need SSR or Edge functions, prefer deploying to Vercel.
198-
199-
---
200-
20175
## Alternative: Deploy to Vercel
20276
Vercel offers zero-config Next.js deployments (SSR supported):
20377
- Push your repo to GitHub

0 commit comments

Comments
 (0)