File tree Expand file tree Collapse file tree 5 files changed +57
-3
lines changed
Expand file tree Collapse file tree 5 files changed +57
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ yarn-error.log*
3030
3131# env files
3232.env
33+ .env. *
34+ ! .env.example
3335
3436# vercel
3537.vercel
Original file line number Diff line number Diff line change 1+ RewriteEngine On
2+ RewriteBase /
3+ RewriteRule ^index\.html$ - [L]
4+ RewriteCond %{REQUEST_FILENAME} !-f
5+ RewriteCond %{REQUEST_FILENAME} !-d
6+ RewriteRule . /index.html [L]
Original file line number Diff line number Diff line change 1+ name : Build & Deploy Next.js to cPanel via FTP
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ workflow_dispatch :
7+
8+ jobs :
9+ build-deploy :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - uses : actions/setup-node@v4
15+ with :
16+ node-version : 20
17+ cache : ' npm'
18+
19+ - name : Install deps
20+ run : npm ci
21+
22+ - name : Build (Next static export)
23+ env :
24+ NEXT_PUBLIC_BASE_URL : ${{ secrets.NEXT_PUBLIC_BASE_URL }}
25+ run : npm run build # produces out/
26+
27+ - name : Deploy via FTP to cPanel
28+ uses : SamKirkland/FTP-Deploy-Action@v4
29+ with :
30+ server : ${{ secrets.FTP_HOST }}
31+ username : ${{ secrets.FTP_USER }}
32+ password : ${{ secrets.FTP_PASS }}
33+ local-dir : out/
34+ server-dir : public_html/
35+ exclude : |
36+ **/.git*
37+ **/.github*
38+ **/node_modules/**
39+ **/*.map
Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
2- const nextConfig = { } ;
3-
2+ const nextConfig = {
3+ output : 'export' , // static export
4+ images : { unoptimized : true } , // needed when exporting
5+ // If deploying to a subfolder like /app:
6+ // basePath: '/app',
7+ // assetPrefix: '/app/',
8+ // trailingSlash: true,
9+ } ;
410export default nextConfig ;
Original file line number Diff line number Diff line change 66 "dev" : " next dev" ,
77 "build" : " next build" ,
88 "start" : " next start" ,
9- "lint" : " next lint"
9+ "lint" : " next lint" ,
10+ "export" : " next export"
1011 },
1112 "dependencies" : {
1213 "@fortawesome/free-brands-svg-icons" : " ^6.6.0" ,
You can’t perform that action at this time.
0 commit comments