Skip to content

Commit 3991692

Browse files
committed
Revert to dynamic deployment - keep all API routes and dynamic features
1 parent 410f4dd commit 3991692

File tree

5 files changed

+24
-55
lines changed

5 files changed

+24
-55
lines changed

.github/workflows/deploy.yml

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

33
on:
44
push:
@@ -19,35 +19,40 @@ jobs:
1919
- name: Install deps
2020
run: npm ci
2121

22-
- name: Build Next.js app (Static Export)
22+
- name: Build Next.js app (Dynamic)
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 # produces out/
28+
run: npm run build:next
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: out/
36+
local-dir: ./
3737
server-dir: /
3838
exclude: |
3939
**/.git*
4040
**/.github*
4141
**/node_modules/**
4242
**/*.map
4343
**/.next/cache/**
44+
**/out/**
4445
**/.env*
4546
**/README.md
4647
**/deploy.yml
4748
**/deploy.sh
49+
**/build-static.js
4850
4951
- name: Notify deployment completion
5052
run: |
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!"
53+
echo "🚀 Dynamic deployment completed!"
54+
echo "📝 Manual steps required:"
55+
echo " 1. Go to cPanel → Node.js Apps"
56+
echo " 2. Click 'Install Dependencies'"
57+
echo " 3. Click 'Build Application'"
58+
echo " 4. Click 'Start Application'"

.htaccess

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

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

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

build-static.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

next.config.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
// Static export for cPanel - uses much less memory
4-
output: "export",
5-
images: { unoptimized: true }, // needed when exporting
3+
// Dynamic deployment - keep all features
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+
},
611

712
// Configure for subfolder deployment
813
basePath: "/acm",
914
assetPrefix: "/acm/",
1015

11-
// Exclude API routes from static export
12-
trailingSlash: true,
13-
1416
// Webpack optimization for memory
1517
webpack: (config, { isServer }) => {
1618
if (!isServer) {

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
7-
"build": "node build-static.js",
8-
"build:next": "next build",
7+
"build": "next build",
98
"start": "node server.js",
109
"lint": "next lint"
1110
},

0 commit comments

Comments
 (0)