Skip to content

ci: add Cloudflare docs previews for fork PRs - #2691

Merged
fengmk2 merged 12 commits into
mainfrom
ci/docs-fork-previews
Sep 14, 2026
Merged

ci: add Cloudflare docs previews for fork PRs#2691
fengmk2 merged 12 commits into
mainfrom
ci/docs-fork-previews

Conversation

@fengmk2

@fengmk2 fengmk2 commented Sep 14, 2026

Copy link
Copy Markdown
Member

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.yml and publish-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 --> X
Loading

The 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.

Cloudflare documentation preview: https://pr-2691-viteplus-dev.voidzero-docs.workers.dev

Commit: 3119b04ffcba9aad36465172edbe28da4ecfa9df

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 to main. Set CLOUDFLARE_ACCOUNT_ID as a variable and CLOUDFLARE_API_TOKEN as a secret there. See .github/workflows/deploy-docs-fork-preview.yml for setup details. The trusted workflow must be on main before fork previews can deploy.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 14, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://ci-docs-fork-previews-viteplus-dev.voidzero-docs.workers.dev (commit 3119b04)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b60be25d-viteplus-dev.voidzero-docs.workers.dev 3119b04 2026-09-14T19:21:58.057Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ed7adf8f-viteplus-dev.voidzero-docs.workers.dev 1635128 2026-09-14T18:59:06.278Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d649b4df-viteplus-dev.voidzero-docs.workers.dev a62f52a 2026-09-14T16:19:54.496Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://5d18a330-viteplus-dev.voidzero-docs.workers.dev bae1bf4 2026-09-14T15:38:49.573Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ff8823c4-viteplus-dev.voidzero-docs.workers.dev 6f50625 2026-09-14T07:42:21.775Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://0ee5e784-viteplus-dev.voidzero-docs.workers.dev a224238 2026-09-14T07:09:00.329Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://be59dbd3-viteplus-dev.voidzero-docs.workers.dev 2a5cd30 2026-09-14T06:53:01.140Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://fd656cff-viteplus-dev.voidzero-docs.workers.dev 770b234 2026-09-14T06:49:35.574Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f17f4612-viteplus-dev.voidzero-docs.workers.dev f7d8e2c 2026-09-14T06:31:45.282Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://eb74d9cb-viteplus-dev.voidzero-docs.workers.dev ec7790a 2026-09-14T06:29:04.530Z Visit the dashboard ↗

View all previews: View all previews ↗

@fengmk2
fengmk2 force-pushed the ci/docs-fork-previews branch 2 times, most recently from ec7790a to f7d8e2c Compare September 14, 2026 06:30
@fengmk2
fengmk2 marked this pull request as ready for review September 14, 2026 06:48
@fengmk2 fengmk2 added the docs-preview Request a docs preview of the current fork PR commit; reapply after updates. label Sep 14, 2026
@fengmk2 fengmk2 self-assigned this Sep 14, 2026
@fengmk2

fengmk2 commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T15:49:10.513683Z bae1bf4 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/deploy-docs-fork-preview.yml Outdated
@fengmk2
fengmk2 force-pushed the ci/docs-fork-previews branch from bae1bf4 to fd77aa4 Compare September 14, 2026 16:15
@fengmk2
fengmk2 force-pushed the ci/docs-fork-previews branch from fd77aa4 to a62f52a Compare September 14, 2026 16:17
@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels Sep 14, 2026
@fengmk2
fengmk2 force-pushed the ci/docs-fork-previews branch from a62f52a to 7b0d2bb Compare September 14, 2026 18:30
@fengmk2
fengmk2 merged commit df73ec0 into main Sep 14, 2026
111 checks passed
@fengmk2
fengmk2 deleted the ci/docs-fork-previews branch September 14, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-preview Request a docs preview of the current fork PR commit; reapply after updates. test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants