Trigger docs deploy via repository_dispatch instead of a Vercel hook - #102
Merged
Conversation
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).
|
The templates docs preview for this pull request has been deployed to Vercel!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source and scope
Requirement: a merge to this repo's
mainmust 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 matchingrepository_dispatchtrigger. Merge order doesn't matter — this dispatch is a harmless no-op until #864 is on the docs repo'smain.Why not the Vercel deploy hook it replaces
The public docs site is published by relationalai-docs'
Vercel branch deployspipeline:vercel build --prod→ validate → deploy candidate → publish theprod_relationalai_docsAlgolia index →vercel 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 oldcurl "$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
vercel-main-deploy-hook.yml→trigger-docs-deploy.yml.main, it now fires arepository_dispatch(event_type: templates-updated) torelationalai/relationalai-docsviagh api, instead of curling the Vercel hook. That runs the docs repo's real public deploy pipeline, which re-clones templatesmainduringtemplates:syncand 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
DOCS_REPO_TOKENmust be allowed to create arepository_dispatchonrelationalai-docs(contents: write). It's already used here to check out that repo (read); if it lacks write, thegh apicall returns 404/403 and the step fails visibly.VERCEL_HOOK_MAINas targeting the public/main docs deployment (its name, vs. the separateVERCEL_HOOK_PRIVATEthe 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.mainmerge now triggers a full public redeploy (Algolia reindex + promote). Intended, but higher deploy volume.How to verify
mainhere; confirm this workflow runs and thegh api … /dispatchesstep succeeds.Vercel branch deploysrun starts in relationalai-docs anddocs.relational.ai/deployment.jsonupdates.