Skip to content

Trigger docs deploy via repository_dispatch instead of a Vercel hook - #102

Merged
somacdivad merged 1 commit into
mainfrom
chore/trigger-docs-deploy-via-dispatch
Aug 19, 2026
Merged

Trigger docs deploy via repository_dispatch instead of a Vercel hook#102
somacdivad merged 1 commit into
mainfrom
chore/trigger-docs-deploy-via-dispatch

Conversation

@somacdivad

Copy link
Copy Markdown
Collaborator

Source and scope

Requirement: a merge to this repo's main must trigger a fresh deployment of the docs website. This is the templates-repo half; it pairs with docs-repo PR RelationalAI/relationalai-docs#864, which adds the matching repository_dispatch trigger. Merge order doesn't matter — this dispatch is a harmless no-op until #864 is on the docs repo's main.

Why not the Vercel deploy hook it replaces

The public docs site is published by relationalai-docs' Vercel branch deploys pipeline: vercel build --prod → validate → deploy candidate → publish the prod_relationalai_docs Algolia indexvercel promote → verify. The docs project has Vercel git-deploy disabled (vercel.json"git": { "deploymentEnabled": false }) precisely because deploys are meant to go through that pipeline. The old curl "$VERCEL_HOOK_MAIN" triggered a Vercel-side build that bypasses the indexing/validation/promote steps, so it can't correctly publish the site.

What changed

  • Renamed vercel-main-deploy-hook.ymltrigger-docs-deploy.yml.
  • On push to main, it now fires a repository_dispatch (event_type: templates-updated) to relationalai/relationalai-docs via gh api, instead of curling the Vercel hook. That runs the docs repo's real public deploy pipeline, which re-clones templates main during templates:sync and republishes.

Why

Templates content is pulled into the docs site at build time; with the docs project's git-deploy disabled, a merge here otherwise never reached the live site. Dispatching the docs pipeline closes that gap correctly.

Risks

  • Token scope: DOCS_REPO_TOKEN must be allowed to create a repository_dispatch on relationalai-docs (contents: write). It's already used here to check out that repo (read); if it lacks write, the gh api call returns 404/403 and the step fails visibly.
  • Assumption about the old hook: I treated VERCEL_HOOK_MAIN as targeting the public/main docs deployment (its name, vs. the separate VERCEL_HOOK_PRIVATE the docs repo uses for the private site). If that secret was load-bearing for something else, flag it in review — it becomes unused after this change.
  • Every main merge now triggers a full public redeploy (Algolia reindex + promote). Intended, but higher deploy volume.

How to verify

  1. Merge this and #864.
  2. Push a trivial change to main here; confirm this workflow runs and the gh api … /dispatches step succeeds.
  3. Confirm a Vercel branch deploys run starts in relationalai-docs and docs.relational.ai/deployment.json updates.

On push to main, fire a repository_dispatch (event_type: templates-updated)
to relationalai-docs so its full public deploy pipeline (build -> Algolia
index -> promote) republishes the site. Replaces the VERCEL_HOOK_MAIN curl,
which bypassed that pipeline. Requires DOCS_REPO_TOKEN to have permission to
create a repository_dispatch on relationalai-docs (contents: write).
@github-actions

Copy link
Copy Markdown

The templates docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-3ztokwm18-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/8vybZoU8hSP5mMPvSQM6GYkU2Mvs

@somacdivad
somacdivad merged commit 3d912d6 into main Aug 19, 2026
1 check passed
@somacdivad
somacdivad deleted the chore/trigger-docs-deploy-via-dispatch branch August 19, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant