Skip to content

Fix GitHub Pages deploy by exporting Next.js build to frontend/out - #1

Merged
Rishisharma029 merged 2 commits into
mainfrom
copilot/fix-build-and-deploy-job
Jul 31, 2026
Merged

Fix GitHub Pages deploy by exporting Next.js build to frontend/out#1
Rishisharma029 merged 2 commits into
mainfrom
copilot/fix-build-and-deploy-job

Conversation

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The build-and-deploy workflow failed because actions/upload-pages-artifact expects ./frontend/out, but the frontend build produced only .next. This PR aligns Next.js output with the deploy workflow artifact path.

  • Build output alignment

    • Enable static export in frontend/next.config.js so npm run build emits frontend/out (the directory uploaded by the Pages workflow).
  • Dev-only API proxy behavior

    • Keep local /api/* proxy rewrites, but define them only in development to avoid export-time custom route incompatibilities.
  • Config change (core)

    const nextConfig = {
      reactStrictMode: true,
      output: 'export',
      images: { domains: ['api.dicebear.com'] },
    }
    
    if (process.env.NODE_ENV === 'development') {
      nextConfig.rewrites = async () => [
        { source: '/api/:path*', destination: 'http://127.0.0.1:8000/api/:path*' },
      ]
    }

@Rishisharma029
Rishisharma029 marked this pull request as ready for review July 31, 2026 14:57
Copilot AI review requested due to automatic review settings July 31, 2026 14:57
Copilot AI changed the title [WIP] Fix failing GitHub Actions job build-and-deploy Fix GitHub Pages deploy by exporting Next.js build to frontend/out Jul 31, 2026
Copilot AI requested a review from Rishisharma029 July 31, 2026 14:58
@Rishisharma029
Rishisharma029 merged commit ddab56d into main Jul 31, 2026
3 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

output: 'export' is enabled unconditionally, which is incompatible with next start and breaks the repo’s Docker Compose/self-hosted deployment path.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR updates the Next.js configuration to produce a static export in frontend/out so the GitHub Pages workflow can upload the expected artifact, while keeping the /api/* proxy rewrites limited to local development.

Changes:

  • Enable static export output (output: 'export') so npm run build can generate frontend/out.
  • Move /api/:path* rewrite configuration behind a development-only guard to avoid export-time route incompatibilities.
File summaries
File Description
frontend/next.config.js Enables static export and scopes rewrites to development to support GitHub Pages artifact upload.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread frontend/next.config.js
Comment on lines 2 to 7
const nextConfig = {
reactStrictMode: true,
output: 'export',
images: {
domains: ['api.dicebear.com'],
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants