Skip to content

fix(ci): add NEXT_PUBLIC_API_URL to API deploy workflows - #509

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/deploy-api-env-vars
Dec 26, 2025
Merged

saddlepaddle merged 1 commit into
mainfrom
fix/deploy-api-env-vars

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Dec 26, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add missing NEXT_PUBLIC_API_URL env var to API deploy jobs in both preview and production workflows
  • The API app requires this in its env validation but it was missing from the deploy scripts

Test plan

  • Verify preview deploy succeeds for API
  • Verify production deploy succeeds for API

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced deployment workflows for preview and production environments to ensure consistent environment variable configuration across all deployment steps.

✏️ Tip: You can customize this high-level summary in your review settings.

The API app requires NEXT_PUBLIC_API_URL in its env validation,
but it was missing from both preview and production deploy jobs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 26, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds NEXT_PUBLIC_API_URL environment variable to API deployment steps in both preview and production GitHub Actions workflows. The variable is derived from configuration or secrets and injected into Vercel deployment commands to ensure API URL accessibility during API deployment builds.

Changes

Cohort / File(s) Summary
Deployment Workflow Environment Variables
.github/workflows/deploy-preview.yml, .github/workflows/deploy-production.yml
Adds NEXT_PUBLIC_API_URL environment variable injection to API deployment steps. In preview workflow, variable is sourced from API_ALIAS in global env and passed to both vercel deploy and build/deploy commands. In production workflow, variable is sourced from secrets.NEXT_PUBLIC_API_URL and passed via --env flag to vercel deploy commands.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • #345: Adds environment variables (BLOB_READ_WRITE_TOKEN, NEXT_PUBLIC_WEB_URL) to the same deploy workflow files for Vercel deployment steps.
  • #331: Modifies the "Build and Deploy API" step in CI workflows by adding environment variables (DATABASE_URL, DATABASE_URL_UNPOOLED) to the deploy-api job.
  • #350: Modifies GitHub Actions deploy workflows to pass runtime environment variables into Vercel deploy commands using --env flags and propagating NEXT_PUBLIC_* runtime secrets.

Poem

🐰 Through workflows we hop, where deployments take flight,
With NEXT_PUBLIC_API_URL gleaming so bright!
From preview to production, the variables align,
Now secrets and configs in harmony shine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding NEXT_PUBLIC_API_URL environment variable to API deploy workflows in CI configuration.
Description check ✅ Passed The description provides a summary and test plan, but is missing required template sections like Type of Change, Related Issues, and Screenshots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/deploy-api-env-vars

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0863ea0 and 8bf8cde.

📒 Files selected for processing (2)
  • .github/workflows/deploy-preview.yml
  • .github/workflows/deploy-production.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Deploy Marketing
  • GitHub Check: Deploy Web
  • GitHub Check: Deploy Admin
  • GitHub Check: Deploy Docs
  • GitHub Check: Deploy API
  • GitHub Check: Build
🔇 Additional comments (3)
.github/workflows/deploy-production.yml (2)

73-73: LGTM! Environment variable properly added.

The addition of NEXT_PUBLIC_API_URL to the env block is correct and consistent with other deployment jobs in this workflow.

Ensure that the NEXT_PUBLIC_API_URL secret is configured in the GitHub repository settings under the production environment before merging.


107-107: LGTM! Variable correctly passed to Vercel deploy.

The NEXT_PUBLIC_API_URL is properly passed to the Vercel deploy command using the --env flag, matching the pattern used by other environment variables and consistent with other deployment jobs.

.github/workflows/deploy-preview.yml (1)

124-124: LGTM! The addition of NEXT_PUBLIC_API_URL to both the environment block and the Vercel deploy command is correct and follows the pattern used by other deployment jobs.

The production workflow (deploy-production.yml) was also updated and includes NEXT_PUBLIC_API_URL in both the env block and the vercel deploy command. The preview workflow uses a dynamic value based on the PR number, while the production workflow uses a value from secrets—both approaches are appropriate for their respective environments.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Dec 26, 2025 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

Service Status
Neon Database (Neon) ✅

Thank you for your contribution! 🎉


Preview resources have been processed for cleanup

@saddlepaddle
saddlepaddle merged commit de14fe1 into main Dec 26, 2025
12 checks passed
@Kitenite
Kitenite deleted the fix/deploy-api-env-vars branch December 28, 2025 20:10

This branch was previously deployed

1 inactive deployment
preview — 8bf8cde3 Deployed Dec 26, 2025 by saddlepaddle via Deploy Docs #486
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.

1 participant