Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a two-environment GitHub Pages deployment workflow (production + staging) by adding a staging deploy command tied to the dev branch and configuring Next.js to support a staging basePath.
Changes:
- Parameterize
scripts/check-branch.jsso deploy scripts can enforce different allowed branches (1.xvsdev). - Add
build:staginganddeploy:stagingscripts to publish to a separate staging repo with a projectbasePath. - Update README and deployment docs to describe the new staging + promotion workflow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/check-branch.js | Makes branch enforcement configurable via CLI arg for prod vs staging deploys. |
| package.json | Adds staging build/deploy scripts and ensures dotfiles are published. |
| next.config.ts | Sets basePath from NEXT_BASE_PATH to support staging under a GitHub Pages project path. |
| README.md | Documents environments and the new dev → staging → prod promotion flow. |
| docs/deployment.md | Expands deployment docs for staging and production, including troubleshooting. |
Comments suppressed due to low confidence (1)
scripts/check-branch.js:14
check-branch.jscurrently fails open: ifgit rev-parseerrors (e.g., not a git checkout, missing git, permissions), the script warns and allows the deploy/build to proceed. Since this script is explicitly used to enforce deploy branch restrictions, it should fail closed and stop the deploy when the branch cannot be determined.
try {
const branch = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
if (branch !== allowedBranch) {
console.error(`Deploy blocked: must be on branch '${allowedBranch}' (currently on '${branch}').`);
process.exit(1);
}
} catch (error) {
console.warn('Could not determine git branch, proceeding with build...');
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+25
| 1. Open a PR from your feature branch targeting `dev` | ||
| 2. After merge, deploy to staging and verify: `yarn deploy:staging` | ||
| 3. Once staging is confirmed, open a PR from `dev` into `1.x` | ||
| 4. After merge, deploy to production: `yarn deploy` |
14 tasks
Testing dev branch flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
READY FOR REVIEW
Summary
devbranch, and we add scripts to deploy thedevbranch to a secondary staging repo.Review By (Date)
Criticality
Review Tasks
Setup tasks and/or behavior to test
dev(or1.xfor urgent fixes)devgit checkout dev && git pull && yarn deploy:stagingdevinto1.xgit checkout 1.x && git pull && yarn deployThe deploy scripts enforce branch —
yarn deploywill fail if you're not on1.x, andyarn deploy:stagingwill fail if you're not ondev.Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
@mentionthem here)Resources