ci: add Cloudflare docs previews for fork PRs - #2691
Merged
Conversation
fengmk2
force-pushed
the
ci/docs-fork-previews
branch
2 times, most recently
from
September 14, 2026 06:30
ec7790a to
f7d8e2c
Compare
fengmk2
marked this pull request as ready for review
September 14, 2026 06:48
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bae1bf4d75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
fengmk2
force-pushed
the
ci/docs-fork-previews
branch
from
September 14, 2026 16:15
bae1bf4 to
fd77aa4
Compare
Brooooooklyn
approved these changes
Sep 14, 2026
fengmk2
force-pushed
the
ci/docs-fork-previews
branch
from
September 14, 2026 16:17
fd77aa4 to
a62f52a
Compare
fengmk2
force-pushed
the
ci/docs-fork-previews
branch
from
September 14, 2026 18:30
a62f52a to
7b0d2bb
Compare
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.
Fork PRs do not receive deployment credentials, so the existing docs deployment cannot publish their previews. These workflows separate the build from deployment, following
publish-preview.ymlandpublish-preview-register.yml.flowchart TD A["Maintainer reviews the commit<br/>and applies the docs-preview label"] subgraph BUILD["Build workflow: fork code, no deployment credentials"] B["Build docs and upload a static artifact"] end subgraph DEPLOY["Deployment workflow: trusted code from main"] C{"PR, commit, label, actor,<br/>workflow and artifact checks pass?"} D["Wait for maintainer approval<br/>in the docs-preview environment"] E{"Approval recorded for this run<br/>and PR still current?"} F["Upload static files to Cloudflare"] G["Update one comment with the PR preview URL<br/>and source commit"] C -- Yes --> D --> E E -- Yes --> F --> G end A --> B B -- "Successful build: workflow_run" --> C C -- No --> X["Do not deploy"] E -- No --> XThe label requests a build. Environment approval permits deployment of that specific run. After reviewing a new commit, remove and reapply
docs-preview. Approve the new deployment run. Contributors need no additional setup.Each PR uses one stable
pr-<number>alias.DOCS_SITE_ORIGIN, installer links, and the bot comment use the same preview address. Later approved uploads update that address. Cloudflare's alias retention limits apply.The workflow updates one bot comment. The following example shows the comment format for PR #2691; it does not indicate a completed deployment.
Uploads run one at a time per PR. With
cancel-in-progress: false, the current upload finishes before the next deployment starts. The default concurrency queue keeps one pending job. Each deployment checks the current PR commit before upload.Before use, configure required reviewers with repository write permission in
docs-preview. Restrict that environment tomain. SetCLOUDFLARE_ACCOUNT_IDas a variable andCLOUDFLARE_API_TOKENas a secret there. See.github/workflows/deploy-docs-fork-preview.ymlfor setup details. The trusted workflow must be onmainbefore fork previews can deploy.