Commit Graph
7 Commits
Author SHA1 Message Date
xiaohei 7c1eea53b7 fix(azure): set output_location to empty string when using IS_STATIC_EXPORT
When IS_STATIC_EXPORT=true is set, Azure SWA automatically detects
Next.js static export output at 'out/' directory. Explicitly setting
output_location causes artifact detection to fail.

Per Azure official documentation:
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-static-export
2025-12-29 08:36:43 +00:00
xiaohei ca537c971e fix(azure): apply official Azure SWA static export configuration
Per Microsoft official documentation:
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-static-export

Key changes:
- Set IS_STATIC_EXPORT=true environment variable (required for static Next.js)
- Set output_location to 'out' (Next.js static export default)
- Set api_location to empty string (no API for static export)
- Keep skip_app_build=true (we build in previous step)

This is the official Azure recommended configuration for Next.js static sites.
2025-12-29 08:31:08 +00:00
xiaohei 4511fe5694 fix(azure): apply correct Azure SWA approach for Next.js
BREAKING CHANGES:
- Switch to static export mode (output: 'export') per Azure SWA best practices
- Remove staticwebapp.config.json to avoid routes.json conflict
- Convert server-side layouts to client-side only (remove cookies() usage)
- Auth now handled entirely by client-side AuthGuard component
- Output directory changed from .next/standalone to 'out'
- Remove redirects from next.config (not supported in static export)

This aligns with Azure Static Web Apps' official recommendation for Next.js.
Server-side features (SSR, API routes, server actions) are not supported.
All authentication and routing is client-side via React components.
2025-12-29 08:05:05 +00:00
xiaohei 00aef0bea8 feat(azure): apply Azure SWA best practices for Next.js
- Add standalone output mode in next.config.mjs
- Configure environment variables with .env.example
- Update staticwebapp.config.json with proper routing and fallback
- Optimize GitHub Actions workflow with npm cache and env vars
- Set output_location to .next/standalone for SWA deployment
- Preserve all business logic in API client, auth, and components
2025-12-29 07:58:24 +00:00
xiaohei 1b6c528be0 fix(swa): apply Azure best practices - remove config, use standalone Next.js build 2025-12-29 07:53:07 +00:00
xiaohei a184653c82 ci(swa): skip deploy when token missing; align Next.js output to .next 2025-12-29 07:45:39 +00:00
xiaohei 5c8cfd6c54 chore(swa): add Azure Static Web Apps CI/CD workflow for Next.js (.next output, Node 20.11.1) 2025-12-29 07:10:25 +00:00