4747 - name : Build with Next.js
4848 run : |
4949 echo "Starting Next.js build process..."
50+ echo "Checking for config file conflicts..."
51+ ls -la next.config.*
52+
53+ # Remove any conflicting next.config.js if it exists
54+ if [ -f "next.config.js" ]; then
55+ echo "Removing conflicting next.config.js"
56+ rm next.config.js
57+ fi
58+
59+ echo "Current next.config.ts content:"
60+ cat next.config.ts
61+
62+ echo "Running yarn build..."
5063 yarn build
64+
5165 echo "Build completed. Checking output directory..."
5266 if [ -d "./out" ]; then
5367 echo "✅ out directory exists"
@@ -56,10 +70,46 @@ jobs:
5670 echo "❌ out directory not found"
5771 echo "Available directories:"
5872 ls -la ./
59- echo "Trying alternative build methods..."
73+ echo "Checking .next directory:"
74+ ls -la .next/ 2>/dev/null || echo "No .next directory"
75+
76+ echo "Trying manual static export..."
6077 rm -rf .next out
61- NODE_ENV=production yarn next build || echo "Alternative build failed"
78+ NODE_ENV=production yarn next build
79+
80+ echo "After rebuild, checking directories:"
6281 ls -la ./
82+
83+ if [ ! -d "./out" ]; then
84+ echo "Static export still failed. Checking Next.js export structure..."
85+ echo "Searching for static files in .next:"
86+ find .next -name "*.html" -type f || echo "No HTML files found"
87+
88+ echo "Manual export attempt..."
89+ mkdir -p out
90+
91+ # Copy static assets
92+ if [ -d ".next/static" ]; then
93+ echo "Copying .next/static to out/_next/static"
94+ mkdir -p out/_next
95+ cp -r .next/static out/_next/
96+ fi
97+
98+ # Copy server-generated pages
99+ if [ -d ".next/server/pages" ]; then
100+ echo "Copying server pages"
101+ find .next/server/pages -name "*.html" -exec cp {} out/ \;
102+ fi
103+
104+ # Copy standalone pages if they exist
105+ if [ -d ".next/standalone" ]; then
106+ echo "Copying standalone files"
107+ cp -r .next/standalone/* out/ 2>/dev/null || echo "No standalone files"
108+ fi
109+
110+ echo "Final out directory contents:"
111+ ls -la ./out/
112+ fi
63113 fi
64114 env :
65115 NEXT_PUBLIC_AIRTABLE_PAT : ${{ secrets.NEXT_PUBLIC_AIRTABLE_PAT }}
0 commit comments