Building and Deploying
Local Development
To run the site locally, you can use the following command:
pnpm run serve:<brand>
(e.g., pnpm run serve:acme)
Building and Deploying
To deploy the sites, we follow a workflow where we build the documentation locally and then push the generated static files to the repository. Cloudflare Pages is configured to serve these pre-built files.
Steps to Deploy
-
Build All Brands: Run the build script to generate the static sites for all brands.
pnpm run build:allThis command generates the static sites in the
dist/directory. -
Commit and Push: Commit the changes (including the updated
dist/folder) and push to the repository.git add .
git commit -m "Update documentation build"
git push
Cloudflare Pages Setup
We use Cloudflare Pages to host our documentation. Each brand has a corresponding Cloudflare Pages project that is connected to this GitHub repository.
When you push the updates, Cloudflare Pages pulls the latest code. Since the sites are already built in the dist/ folder, Cloudflare simply serves these files.
Working around Build Limits
Cloudflare Pages imposes limits on build minutes. By building the documentation locally (or in our own CI environment) and pushing the artifacts:
- We use 0 Cloudflare build minutes.
- We avoid timeouts for large builds.
- We ensure that exactly what was tested locally is what gets deployed.
Why Cloudflare Pages?
- Global CDN: Cloudflare Pages is backed by Cloudflare's massive global network, ensuring low latency and fast loading times for users anywhere.
- Integration: Seamless integration with GitHub/GitLab.
- Cost: The generous free tier and pay-as-you-go model make it a cost-effective solution for hosting static documentation.