One docs repo → many Vercel projects (one per projects/*.yaml). This repo defines projects and syncs them to Vercel; the docs repo holds content. Push here → Vercel projects + env + domains; push to docs repo (or trigger) → redeploy.
-
config.yaml:
baseDomain,docsRepo.repository,docsRepo.projectId(GitLab numeric ID),docsRepo.productionBranch, optionalvercel.teamId,dns.domain,dns.vercelCnameTarget. -
projects/.yaml: Env-style keys (sync-vercel pushes these to Vercel as
PROJECT_NAME,PROJECT_HOME_URL,ACCENT_COLOR,TINTED_ACCENT_COLOR,FOREGROUND_COLOR,DATA_URLandNEXT_PUBLIC_*):YAML key Env var Example project_namePROJECT_NAMEZideproject_home_urlPROJECT_HOME_URLhttps://zide.bitspace.org.inaccent_colorACCENT_COLOR#CCFF00tinted_accent_colorTINTED_ACCENT_COLOR#FBFFEBforeground_colorFOREGROUND_COLOR#0A0A0Adata_urlDATA_URLhttps://api.docs.zide.bitspace.org.inorhttp://localhost:8000/data.jsonOptional:
project_subdomain(defaults to file id for domain);project_env(extra env key/values).
Global cron: The cron:check-data job (runs on schedule) checks all projects with DOCS_DEPLOYMENT_MANAGED, fetches each DATA_URL, and triggers a rebuild only for the project(s) whose timestamp is newer than last run (via Vercel API, latest docs ref/sha from config.docsRepo). Only DOCS_VERCEL_TOKEN required. GitLab Pages publishes a status page (last rebuilt per project, and projects not rebuilding with reasons); see Deployments → Pages.
Set up the schedule (required for cron to run):
- In this project go to CI/CD → Schedules.
- Click Create a new pipeline schedule.
- Description: e.g.
Check data and rebuild. - Interval pattern: choose Custom and enter cron
* * * * *(every minute) or*/5 * * * *(every 5 minutes). - Target branch:
main. - Save and ensure the schedule is enabled.
After that, pipelines will run on the schedule; the cron:check-data job runs only when the pipeline source is Schedule (see CI/CD → Pipelines). Optional env: CRON_TIMESTAMP_FIELD, CRON_TIMESTAMPS_FILE.
| Job | When | Needs |
|---|---|---|
| sync-vercel | main, config/projects change (not on trigger) | DOCS_VERCEL_TOKEN |
| dns:cloudflare | main, config/projects change | DOCS_CLOUDFLARE_API_TOKEN |
| deploy-docs | trigger with DOCS_SHA, or main config/projects change, or manual | DOCS_VERCEL_TOKEN, DOCS_SHA (or from get-latest) |
| cron:check-data | pipeline source = schedule (e.g. every minute: * * * * *) |
DOCS_VERCEL_TOKEN |
| pages | main | (publishes public/ for GitLab Pages – cron docs) |
Removing a projects/<id>.yaml and running sync-vercel deletes that Vercel project and its Cloudflare CNAME (if DNS is Cloudflare).
- DOCS_VERCEL_TOKEN (or VERCEL_TOKEN) — required for sync and deploy.
- DOCS_CLOUDFLARE_API_TOKEN (or CLOUDFLARE_API_TOKEN) — optional; for DNS and TXT verification.
- DOCS_VERCEL_TEAM_ID — optional; for Vercel team.
In the docs repo CI (e.g. on push to main), trigger this repo so deploy-docs runs:
- curl -X POST -F token=${DOCS_DEPLOYMENT_TRIGGER_TOKEN} -F ref=main \
-F "variables[DOCS_REF]=${CI_COMMIT_REF_NAME}" -F "variables[DOCS_SHA]=${CI_COMMIT_SHA}" \
"https://gitlab.com/api/v4/projects/${DOCS_DEPLOYMENT_PROJECT_ID}/trigger/pipeline"Set DOCS_DEPLOYMENT_TRIGGER_TOKEN and DOCS_DEPLOYMENT_PROJECT_ID in the docs repo (token from this repo: Settings → CI/CD → Pipeline triggers). ref is the branch in this repo (e.g. main).
npm run validate
npm run sync-vercel
npm run dns
DOCS_REF=main DOCS_SHA=<sha> npm run deploy-docsExpect at build/runtime: PROJECT_NAME, PROJECT_HOME_URL, ACCENT_COLOR, TINTED_ACCENT_COLOR, FOREGROUND_COLOR, DATA_URL. sync-vercel sets these from project yaml.