Skip to content

Add dev workflow script and fix build.content.mjs#574

Draft
jamiefolsom wants to merge 2 commits intodevelopfrom
feature/dev-workflow
Draft

Add dev workflow script and fix build.content.mjs#574
jamiefolsom wants to merge 2 commits intodevelopfrom
feature/dev-workflow

Conversation

@jamiefolsom
Copy link
Copy Markdown
Member

@jamiefolsom jamiefolsom commented Mar 13, 2026

Summary

  • Fix build.content.mjs: support GITHUB_BRANCH env var and remove stale content/ before copying
  • Add scripts/dev.sh: single-command local dev workflow that handles site switching, version matching, env var isolation, and content cleanup
  • Add scripts/sites.example.json: template for local site registry (actual sites.json is gitignored)
  • Add npm run dev script entry

Usage

scripts/dev.sh --init            # first-time: generate sites.json from Netlify account
npm run dev -- uss               # match deployed version, switch, start
npm run dev -- atlas --no-match  # skip version matching
npm run dev -- --list            # show available sites

Test plan

  • --init generates scripts/sites.json with all CDP sites from Netlify
  • npm run dev -- <site> links to correct site and starts dev server
  • Version matching checks out the exact deployed commit
  • Switching between sites loads correct content (no stale env vars or content)
  • --skip-clean skips content cleanup for faster restarts
  • .env is backed up during run and restored on exit

Fix build.content.mjs:
- Support GITHUB_BRANCH env var for cloning content repos
- Remove content/ before copying to prevent merge artifacts

Add scripts/dev.sh - single-command local dev workflow:
- Checks out the exact commit deployed on the Netlify site
- Unlinks/relinks Netlify site to ensure correct env vars
- Clears process env vars that override site settings
- Backs up .env to let Netlify site vars take priority
- Cleans generated content, .tina/, and i18n files
- Sets USE_CONTENT_CACHE=true to avoid loader timeouts
- Kills stale processes on ports 4321/9000
- Starts netlify dev

Usage: npm run dev -- <site> (sites defined in scripts/sites.json)
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for gbof-c19nyc-staging ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/gbof-c19nyc-staging/deploys/69b43f7059e902000897d5ff
😎 Deploy Preview https://deploy-preview-574--gbof-c19nyc-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for juel-ancestry ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/juel-ancestry/deploys/69b43f702f373f00089731c4
😎 Deploy Preview https://deploy-preview-574--juel-ancestry.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for juel-staging ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/juel-staging/deploys/69b43f70c21e020008093d0a
😎 Deploy Preview https://deploy-preview-574--juel-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for pss-scavenger-hunt ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/pss-scavenger-hunt/deploys/69b43f707efb5900079f91e2
😎 Deploy Preview https://deploy-preview-574--pss-scavenger-hunt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for padp-staging ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/padp-staging/deploys/69b43f70a3405f0008078270
😎 Deploy Preview https://deploy-preview-574--padp-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for juel-life ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/juel-life/deploys/69b43f70c570850008c29f75
😎 Deploy Preview https://deploy-preview-574--juel-life.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for libertos ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/libertos/deploys/69b43f70c570850008c29f77
😎 Deploy Preview https://deploy-preview-574--libertos.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for registro-project ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/registro-project/deploys/69b43f702f373f00089731c8
😎 Deploy Preview https://deploy-preview-574--registro-project.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for universities-studying-slavery ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/universities-studying-slavery/deploys/69b43f7071a57600089cdefd
😎 Deploy Preview https://deploy-preview-574--universities-studying-slavery.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for gamepossible ready!

Name Link
🔨 Latest commit cea89c9
🔍 Latest deploy log https://app.netlify.com/projects/gamepossible/deploys/69b43f70b4e97a00082613aa
😎 Deploy Preview https://deploy-preview-574--gamepossible.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Queries Netlify API for all CDP sites the user has access to and
writes scripts/sites.json. Developers can then edit the file to
use shorter names.
@jamiefolsom jamiefolsom requested a review from ajolipa March 16, 2026 18:09
@jamiefolsom jamiefolsom self-assigned this Mar 16, 2026
@jamiefolsom jamiefolsom marked this pull request as draft March 23, 2026 20:58
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