Skip to content

Commit cce66b9

Browse files
Added conditional to output prop.
1 parent 1ba3ede commit cce66b9

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,19 @@ jobs:
6767
while ! nc -z localhost 5434; do sleep 1; done
6868
echo "✅ Database is healthy."
6969
70+
# =====================================================================
71+
# THE FIX: Force the build to run in default server mode.
72+
# This overrides any conflicting environment variables.
73+
# =====================================================================
74+
echo "Ensuring build runs in default server mode..."
75+
export NEXT_OUTPUT_MODE='standalone'
76+
7077
# Step 4: Build the new webapp image.
7178
echo "Building the latest webapp image..."
7279
docker compose build webapp
7380
74-
# Step 5: THE DEFINITIVE FIX. Forcefully remove the old webapp container by its exact name.
75-
# This is the most direct command and bypasses any ambiguity from Docker Compose's state.
76-
echo "Forcefully removing old webapp container to prevent conflicts..."
81+
# Step 5: Forcefully remove the old webapp container to prevent conflicts.
82+
echo "Forcefully removing old webapp container if it exists..."
7783
docker rm -f codebuilder-webapp || true
7884
7985
# Step 6: Deploy the new webapp container.

next.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { NextConfig } from 'next'
22

3+
// A helper variable to easily check if we are in static export mode.
4+
const isStaticExport = process.env.NEXT_OUTPUT_MODE === 'export'
5+
36
const nextConfig: NextConfig = {
47
/**
58
* FIX: The 'turbo' settings have been moved to the top-level 'turbopack' property
@@ -9,12 +12,14 @@ const nextConfig: NextConfig = {
912
resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
1013
},
1114

12-
output: 'export',
15+
// Conditionally set the output mode for the build.
16+
output: isStaticExport ? 'export' : undefined,
1317

1418
// Note: If you are using next/image, you may need to add an
1519
// unoptimized: true flag here if you are not using a custom loader.
20+
// Conditionally disable image optimization only for the static export.
1621
images: {
17-
unoptimized: true,
22+
unoptimized: isStaticExport,
1823
},
1924

2025
eslint: {

0 commit comments

Comments
 (0)