| Environment | Branch | URL | Command |
|---|---|---|---|
| Production | 1.x |
https://ifdm-learning.stanford.edu/ | yarn deploy |
| Staging | dev |
https://su-sws.github.io/ifdm_learning_apps_staging/ | yarn deploy:staging |
Feature branches are developed and reviewed via pull request, then merged in two stages:
feature/my-branch → PR → dev → yarn deploy:staging → QA on staging
↓ approved
PR to 1.x → yarn deploy → production
- Open a PR from your feature branch targeting
dev - After merge, deploy to staging and verify:
yarn deploy:staging - Once staging is confirmed, open a PR from
devinto1.x - After merge, deploy to production:
yarn deploy
The deploy script enforces that you are on the 1.x branch before building.
- Switch to the latest
1.x:git checkout 1.x && git fetch && git pull - Confirm the correct Node version is active:
nvm use - Deploy:
yarn deploy - Verify at https://github.com/SU-SWS/ifdm_learning_apps/deployments
The staging deploy script enforces that you are on the dev branch before building.
- Switch to the latest
dev:git checkout dev && git fetch && git pull - Confirm the correct Node version is active:
nvm use - Deploy:
yarn deploy:staging - Verify at https://github.com/SU-SWS/ifdm_learning_apps_staging/deployments and preview at https://su-sws.github.io/ifdm_learning_apps_staging/
If the staging environment ever needs to be rebuilt from scratch:
- Create a new GitHub repo:
SU-SWS/ifdm_learning_apps_staging - In that repo's Settings → Pages, set the source to the
gh-pagesbranch - Add the staging remote to your local clone:
Note:
git remote add staging git@github.com:SU-SWS/ifdm_learning_apps_staging.gityarn deploy:stagingtargets this remote directly viagh-pages -r; the local remote entry is for reference and manual pushes only.
Example iFrame:
<iframe src="https://ifdm-learning.stanford.edu/interactives/investment-calculator/"></iframe>See below screencast as an example of embedding the iframe:
- Clear browser cache
- Check GitHub Pages deployment status in the repo's Deployments tab
- Verify the
gh-pagesbranch updated with a recent commit
The staging build sets basePath=/ifdm_learning_apps_staging so all asset paths are prefixed correctly for the project URL. If you see 404s on static assets, confirm build:staging was used (not the plain build command).
- Ensure the source URL is correct
- Check for CORS restrictions
- Test the iframe URL directly in browser
