Branch strategy
| Branch | Purpose | Protection |
|---|---|---|
main | Production releases | PRs only from preview; code owner approval required |
preview | Staging / integration | PRs only from feature branches; CI must pass |
feature/* | Your working branches | No restrictions |
Branch protection rules
main
- Require pull request reviews (code owner approval)
- Require status checks to pass (enforced by
enforce-preview-branch.yml) - Only
previewbranch may open a PR tomain— any other source is rejected by theenforce-preview-branch.ymlworkflow - Direct pushes disabled
preview
- Require CI to pass (
unit-testsandlighthousejobs inci.yml) - PRs from
mainare blocked byenforce-preview-source.yml(thesync-preview.ymlworkflow handles that direction automatically) - Direct pushes disabled
Commit format
Conventional commit types
| Prefix | Release? | Version bump | CHANGELOG section |
|---|---|---|---|
feat: | Yes | Minor (0.1.0 → 0.2.0) | Features |
fix: | Yes | Patch (0.1.0 → 0.1.1) | Bug Fixes |
feat!: | Yes | Major (0.1.0 → 1.0.0) | Features |
perf: | Yes | Patch | Performance |
chore: | No | — | Miscellaneous |
docs: | No | — | Documentation |
ci: | No | — | CI/CD |
test: | No | — | Tests |
refactor: | No | — | Refactoring |
feat!: rename block prop interfacefeat: rename block prop interface\n\nBREAKING CHANGE: Props renamed from camelCase to snake_case
PR flow
Commit with conventional format
Open PR to preview
unit-testsjob: all Vitest tests must passlighthousejob: Lighthouse CI runs against the built siteenforce-preview-source.yml: confirms the source is notmain
Open PR to main
When the staging environment looks good:The
enforce-preview-branch.yml workflow verifies the source is preview. A code owner review is required.Common examples
Why this workflow
preview as integration buffer
All feature branches merge to
preview first. This catches integration issues before they reach production. The preview branch also doubles as the staging environment (SSR + Visual Editing ON).Automated releases
semantic-release eliminates manual version management. The version number is derived from the commit history, making it impossible to forget a version bump or write inconsistent changelog entries.
CI gate
Unit tests and Lighthouse CI run on every PR to
preview. Performance regressions are caught before they land in the staging environment, let alone production.Discord visibility
The sync notification tells the whole team when
preview is safe to branch from again after a release. No need to check the Actions tab.Troubleshooting
PR from feature branch tomain blocked:
Open a PR to preview first, not directly to main. The enforce-preview-branch.yml workflow blocks all non-preview sources.
PR from main to preview blocked:
The enforce-preview-source.yml workflow blocks this direction. It is handled automatically by sync-preview.yml after every release. No manual PR is needed.
sync-preview fails with merge conflict:
A manual merge is required. Checkout preview, merge origin/main, resolve conflicts, and push. Then manually trigger the Discord notification or post an update to the team.
semantic-release creates no release:
All commits since the last tag use non-release prefixes (chore:, docs:, ci:, test:, refactor:). Add at least one feat: or fix: commit to trigger a release.