|
| 1 | +# Website deployment |
| 2 | + |
| 3 | +The marketing and documentation site is deployed to Vercel from this monorepo. |
| 4 | +The application configuration in |
| 5 | +[`apps/web/vercel.json`](../apps/web/vercel.json) is the source of truth for |
| 6 | +framework detection, build and development commands, and output location. |
| 7 | +Vercel derives pnpm from the repository lockfile. Do not add an install override |
| 8 | +with plain `pnpm install`: Vercel uses its oldest available pnpm runtime for that |
| 9 | +override, while this repository requires pnpm 9 or newer. |
| 10 | + |
| 11 | +## Production contract |
| 12 | + |
| 13 | +- **Production branch:** `main`. |
| 14 | +- **Production URL:** <https://headless-web-pi.vercel.app>. |
| 15 | +- **Project root:** `apps/web`. |
| 16 | +- **Application:** `@headless/web`. |
| 17 | +- **Security headers:** `apps/web/next.config.ts`. Do not duplicate them in |
| 18 | + `vercel.json`, where they could drift from local and CI builds. |
| 19 | + |
| 20 | +The Vercel project alias is the canonical domain for now. The LockInTime |
| 21 | +organization does not publish a verifiable custom domain in repository or |
| 22 | +organization metadata, so this project must not claim one. A custom domain can |
| 23 | +replace the alias only after a maintainer confirms control of its DNS. That |
| 24 | +change must update `apps/web/lib/site-metadata.ts`, the GitHub repository |
| 25 | +homepage, this document, and the Vercel production-domain assignment together. |
| 26 | + |
| 27 | +## GitHub integration |
| 28 | + |
| 29 | +Connect the `LockInTime/headless` repository through Vercel for GitHub with |
| 30 | +these project settings: |
| 31 | + |
| 32 | +1. Set Root Directory to `apps/web` so Vercel reads the application-local |
| 33 | + `vercel.json` and detects Next.js from the application package. |
| 34 | +2. Enable "Include source files outside of the Root Directory in the Build |
| 35 | + Step". The site imports checked-in documentation and package metadata from |
| 36 | + the repository root, `apps/headless`, and `packages` during its build. |
| 37 | +3. Set the production branch to `main`. |
| 38 | +4. Keep preview deployments enabled for pull requests and branch pushes. |
| 39 | +5. Keep pull-request comments enabled so each PR receives its immutable preview |
| 40 | + URL. Keep deployment status events enabled so the URL also appears in the |
| 41 | + GitHub deployment timeline. |
| 42 | +6. Do not add a second token-driven GitHub Actions deployment. Two independent |
| 43 | + deployers can race production aliases and make rollback history ambiguous. |
| 44 | + |
| 45 | +The integration is an account-level control and cannot be stored in git. If a |
| 46 | +PR has no Vercel deployment or preview link, treat that as a disconnected or |
| 47 | +disabled integration. A Vercel project maintainer must reconnect the repository |
| 48 | +under Project Settings, Git before the PR is considered deployment-verified. |
| 49 | + |
| 50 | +## Verification |
| 51 | + |
| 52 | +Run the same web gates locally before pushing: |
| 53 | + |
| 54 | +```sh |
| 55 | +pnpm install --frozen-lockfile --filter @headless/web |
| 56 | +pnpm --filter @headless/web lint |
| 57 | +pnpm --filter @headless/web build |
| 58 | +``` |
| 59 | + |
| 60 | +For a pull request, open the Vercel preview from the PR deployment entry and |
| 61 | +check the homepage, one docs route, `robots.txt`, and `sitemap.xml`. Confirm the |
| 62 | +response still carries the CSP, `X-Content-Type-Options`, `X-Frame-Options`, |
| 63 | +`Referrer-Policy`, and `Permissions-Policy` headers declared in |
| 64 | +`apps/web/next.config.ts`. |
| 65 | + |
| 66 | +After merging, verify that the production deployment points at the merge commit |
| 67 | +and that <https://headless-web-pi.vercel.app> serves it. Vercel keeps prior |
| 68 | +production deployments available for rollback. Roll back in Vercel, then |
| 69 | +revert the faulty commit in git so repository history and production converge. |
0 commit comments