File tree Expand file tree Collapse file tree 3 files changed +13
-22
lines changed
Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 1- name : Build & Deploy Next.js to cPanel (Dynamic )
1+ name : Build & Deploy Next.js to cPanel (Static Export )
22
33on :
44 push :
@@ -19,39 +19,35 @@ jobs:
1919 - name : Install deps
2020 run : npm ci
2121
22- - name : Build Next.js app
22+ - name : Build Next.js app (Static Export)
2323 env :
2424 NEXT_PUBLIC_BASE_URL : ${{ secrets.NEXT_PUBLIC_BASE_URL }}
2525 MONGODB_URI : ${{ secrets.MONGODB_URI }}
2626 JWT_SECRET : ${{ secrets.JWT_SECRET }}
2727 BREVO_API_KEY : ${{ secrets.BREVO_API_KEY }}
28- run : npm run build
28+ run : npm run build # produces out/
2929
3030 - name : Deploy via FTP to cPanel
3131 uses :
SamKirkland/[email protected] 3232 with :
3333 server : ${{ secrets.FTP_HOST }}
3434 username : ${{ secrets.FTP_USER }}
3535 password : ${{ secrets.FTP_PASS }}
36- local-dir : . /
36+ local-dir : out /
3737 server-dir : /
3838 exclude : |
3939 **/.git*
4040 **/.github*
4141 **/node_modules/**
4242 **/*.map
4343 **/.next/cache/**
44- **/out/**
4544 **/.env*
4645 **/README.md
4746 **/deploy.yml
4847 **/deploy.sh
4948
5049 - name : Notify deployment completion
5150 run : |
52- echo "🚀 Deployment completed!"
53- echo "📝 Manual steps required:"
54- echo " 1. Go to cPanel → Node.js Apps"
55- echo " 2. Click 'Install Dependencies'"
56- echo " 3. Click 'Build Application'"
57- echo " 4. Click 'Start Application'"
51+ echo "🚀 Static deployment completed!"
52+ echo "✅ Your site is now live at: https://csulb.acm.org/acm"
53+ echo "📝 No manual steps required - static hosting!"
Original file line number Diff line number Diff line change 1- # Node.js App Configuration
1+ # Static Hosting Configuration
22RewriteEngine On
33
4- # Handle Next.js routing
4+ # Handle Next.js routing for static export
55RewriteCond %{REQUEST_FILENAME} !-f
66RewriteCond %{REQUEST_FILENAME} !-d
7- RewriteRule ^(.*)$ /index.html [QSA,L]
7+ RewriteRule ^(.*)$ /acm/ index.html [QSA,L]
88
99# Security headers
1010Header always set X-Frame-Options DENY
Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
3- // Dynamic deployment - no static export
4- // output: "export", // static export
5- // images: { unoptimized: true }, // needed when exporting
6-
7- // Enable image optimization for better performance
8- images : {
9- domains : [ "localhost" , "csulb.acm.org" ] , // Add your domain here
10- } ,
3+ // Static export for cPanel - uses much less memory
4+ output : "export" ,
5+ images : { unoptimized : true } , // needed when exporting
116
127 // Configure for subfolder deployment
138 basePath : "/acm" ,
You can’t perform that action at this time.
0 commit comments