Skip to content

Commit 2c37108

Browse files
committed
docs: document per-branch preview envs and build-time CNAME
Bring docs/deployment.md in line with the updated workflow: per-branch preview environments, branch-keyed concurrency, inactive-then-delete cleanup, and the fact that CNAME is now part of the build output.
1 parent e2df153 commit 2c37108

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

docs/deployment.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,23 @@ The site is hosted on GitHub Pages with a custom domain.
1717

1818
## Workflow
1919

20-
`.github/workflows/deploy.yml` runs on every push:
20+
`.github/workflows/deploy.yml` runs on every push, on branch delete, and on manual `workflow_dispatch`:
2121

2222
1. Installs Bun, runs the test suite, builds the site with `SITE_BASE_URL` set to `/` for `main` or `/preview/<branch>/` for other branches.
2323
2. Runs the axe-core a11y scan against the built output.
2424
3. Checks out `gh-pages`, syncs the build output into the right directory, commits, and pushes.
25-
4. Registers a GitHub Deployment against the `production` or `preview` environment so the URL appears in the PR "Deployments" panel.
25+
4. Registers a GitHub Deployment against the `production` environment (for main) or a per-branch `preview/<sanitized-branch>` environment, so every branch's URL appears in the PR "Deployments" panel and the repo's Deployments page can be used to navigate per-branch preview state.
2626

27-
When a branch is deleted, a cleanup job removes `preview/<sanitized-branch>/` from `gh-pages`.
27+
Concurrency is keyed on the acted-on branch name, not `github.ref`. A `delete` event against `feat/foo` and a `push` to `main` run in different concurrency groups, so a branch cleanup cannot cancel a production deploy.
28+
29+
When a branch is deleted, the `cleanup-preview` job runs and does three things:
30+
- Removes `preview/<sanitized-branch>/` from `gh-pages`.
31+
- Marks every deployment in the `preview/<sanitized-branch>` environment as `inactive`.
32+
- Deletes the per-branch environment via the REST API so it drops out of the Deployments sidebar.
2833

2934
## Custom domain
3035

31-
`CNAME` at the source repo root contains `labs.flexion.us`. The workflow copies it to `gh-pages` if absent.
36+
`CNAME` at the source repo root contains `labs.flexion.us`. The build driver (`src/build/entry.tsx`) copies it into `dist/` on production builds only — preview subdirectories must not carry a CNAME.
3237

3338
## Base path
3439

0 commit comments

Comments
 (0)