Skip to content

Commit f4c8b49

Browse files
committed
Switch to static export to avoid memory issues on cPanel
1 parent e60bf54 commit f4c8b49

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Deploy Next.js to cPanel (Dynamic)
1+
name: Build & Deploy Next.js to cPanel (Static Export)
22

33
on:
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!"

.htaccess

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Node.js App Configuration
1+
# Static Hosting Configuration
22
RewriteEngine On
33

4-
# Handle Next.js routing
4+
# Handle Next.js routing for static export
55
RewriteCond %{REQUEST_FILENAME} !-f
66
RewriteCond %{REQUEST_FILENAME} !-d
7-
RewriteRule ^(.*)$ /index.html [QSA,L]
7+
RewriteRule ^(.*)$ /acm/index.html [QSA,L]
88

99
# Security headers
1010
Header always set X-Frame-Options DENY

next.config.mjs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/** @type {import('next').NextConfig} */
22
const 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",

0 commit comments

Comments
 (0)