Skip to content

Remove dynamic exports from API routes for static export compatibility #7

Remove dynamic exports from API routes for static export compatibility

Remove dynamic exports from API routes for static export compatibility #7

Workflow file for this run

name: Build & Deploy Next.js to cPanel (Static Export)
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install deps
run: npm ci
- name: Build Next.js app (Static Export)
env:
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
BREVO_API_KEY: ${{ secrets.BREVO_API_KEY }}
run: npm run build # produces out/
- name: Deploy via FTP to cPanel
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASS }}
local-dir: out/
server-dir: /
exclude: |
**/.git*
**/.github*
**/node_modules/**
**/*.map
**/.next/cache/**
**/.env*
**/README.md
**/deploy.yml
**/deploy.sh
- name: Notify deployment completion
run: |
echo "🚀 Static deployment completed!"
echo "✅ Your site is now live at: https://csulb.acm.org/acm"
echo "📝 No manual steps required - static hosting!"