Skip to content

Commit d4592d9

Browse files
fix: resolve static export CI/CD issues
- Update CI workflows to use build:static instead of build - Remove deprecated 'next export' command from build:static script - Update performance audit to serve static files - Update accessibility tests to use static server - Update health checks to use /health.json static endpoint - Fix timeout values for static server startup - All CI workflows now properly test static export 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
1 parent 7a6d8a4 commit d4592d9

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

.github/workflows/vizualni-admin-ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
- name: Build Application
141141
run: |
142142
echo "🏗️ Building application..."
143-
npm run build
143+
npm run build:static
144144
working-directory: ${{ env.WORKING_DIRECTORY }}
145145

146146
- name: Bundle Size Analysis
@@ -185,15 +185,20 @@ jobs:
185185
# Install Lighthouse CI
186186
npm install -g @lhci/cli@0.12.x
187187
188-
# Start production server
189-
npm run start &
188+
# Install serve if not present
189+
if ! npm list serve >/dev/null 2>&1; then
190+
npm install --save-dev serve
191+
fi
192+
193+
# Serve static site
194+
npm run serve:static &
190195
SERVER_PID=$!
191196
192197
# Wait for server to start
193-
echo "Waiting for server to start..."
198+
echo "Waiting for static server to start..."
194199
for i in {1..30}; do
195200
if curl -s http://localhost:3000 > /dev/null; then
196-
echo "Server is ready!"
201+
echo "Static server is ready!"
197202
break
198203
fi
199204
sleep 2
@@ -280,12 +285,12 @@ jobs:
280285
const browser = await chromium.launch();
281286
const page = await browser.newPage();
282287
283-
// Start the app
288+
// Serve static app
284289
const { spawn } = require('child_process');
285-
const server = spawn('npm', ['run', 'start'], { stdio: 'pipe' });
290+
const server = spawn('npm', ['run', 'serve:static'], { stdio: 'pipe' });
286291
287-
// Wait for server
288-
await new Promise(resolve => setTimeout(resolve, 15000));
292+
// Wait for static server
293+
await new Promise(resolve => setTimeout(resolve, 5000));
289294
290295
try {
291296
await page.goto('http://localhost:3000', { waitUntil: 'networkidle' });
@@ -496,7 +501,7 @@ jobs:
496501
sleep 30
497502
498503
# Test health endpoint
499-
HEALTH_CHECK=$(curl -s -o /dev/null -w "%{http_code}" https://vizualni-admin-staging.vercel.app/api/health)
504+
HEALTH_CHECK=$(curl -s -o /dev/null -w "%{http_code}" https://vizualni-admin-staging.vercel.app/health.json)
500505
if [ "$HEALTH_CHECK" != "200" ]; then
501506
echo "❌ Health check failed with status $HEALTH_CHECK"
502507
exit 1
@@ -583,7 +588,7 @@ jobs:
583588
584589
# Health checks
585590
for i in {1..5}; do
586-
HEALTH_CHECK=$(curl -s -o /dev/null -w "%{http_code}" https://vizualni-admin.vercel.app/api/health)
591+
HEALTH_CHECK=$(curl -s -o /dev/null -w "%{http_code}" https://vizualni-admin.vercel.app/health.json)
587592
if [ "$HEALTH_CHECK" == "200" ]; then
588593
echo "✅ Health check passed on attempt $i"
589594
break
@@ -600,7 +605,7 @@ jobs:
600605
echo "🧪 Running production smoke tests..."
601606
602607
# Test critical functionality
603-
curl -f https://vizualni-admin.vercel.app/api/health || exit 1
608+
curl -f https://vizualni-admin.vercel.app/health.json || exit 1
604609
605610
echo "✅ Production smoke tests passed"
606611

amplifier/scenarios/dataset_discovery/vizualni-admin/.github/workflows/test-quality-gates.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
run: npx playwright install --with-deps
9292

9393
- name: Build application
94-
run: npm run build
94+
run: npm run build:static
9595

9696
- name: Run visual regression tests
9797
run: npm run test:visual
@@ -181,7 +181,7 @@ jobs:
181181
run: npx playwright install --with-deps
182182

183183
- name: Build application
184-
run: npm run build
184+
run: npm run build:static
185185

186186
- name: Run Lighthouse CI
187187
run: |

amplifier/scenarios/dataset_discovery/vizualni-admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build",
8-
"build:static": "next build && next export",
8+
"build:static": "next build",
99
"start": "next start",
1010
"serve:static": "npx serve out -l 3000",
1111
"lint": "next lint",

0 commit comments

Comments
 (0)