Skip to content

IFDM-153: Set up a staging site#123

Open
imonroe wants to merge 6 commits into
1.xfrom
dev
Open

IFDM-153: Set up a staging site#123
imonroe wants to merge 6 commits into
1.xfrom
dev

Conversation

@imonroe

@imonroe imonroe commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

Summary

  • Here, we introduce a new development work flow. We add a dev branch, and we add scripts to deploy the dev branch to a secondary staging repo.

Review By (Date)

  • When does this need to be reviewed by?

Criticality

  • How critical is this PR on a 1-10 scale? See Severity Assessment.
  • E.g., it affects one site, or every site and product?

Review Tasks

Setup tasks and/or behavior to test

  1. Create a feature branch off dev (or 1.x for urgent fixes)
  2. Open a PR targeting dev
  3. After merge, deploy to staging and verify: git checkout dev && git pull && yarn deploy:staging
  4. Once staging looks good, open a PR from dev into 1.x
  5. After merge, deploy to production: git checkout 1.x && git pull && yarn deploy

The deploy scripts enforce branch — yarn deploy will fail if you're not on 1.x, and yarn deploy:staging will fail if you're not on dev.

Front End Validation

  • Is the markup using the appropriate semantic tags and passes HTML validation?
  • Cross-browser testing has been performed?
  • Automated accessibility scans performed?
  • Manual accessibility tests performed?
  • Design is approved by @ user?

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket(s)
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

Resources

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.

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.js so deploy scripts can enforce different allowed branches (1.x vs dev).
  • Add build:staging and deploy:staging scripts to publish to a separate staging repo with a project basePath.
  • 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.js currently fails open: if git rev-parse errors (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 thread docs/deployment.md
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`
@imonroe imonroe mentioned this pull request Jun 9, 2026
14 tasks
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