Skip to content

ci: Cloudflare preview deployments for docs PRs - #19

Closed
pfeerick wants to merge 1 commit into
edgetx_2.12from
preview-docs
Closed

pfeerick wants to merge 1 commit into
edgetx_2.12from
preview-docs

Conversation

@pfeerick

Copy link
Copy Markdown
Member

Summary

New .github/workflows/preview-docs.yml. For each PR into main or edgetx_2.12, it builds the docs and uploads them as a Cloudflare Worker version with a preview alias. Production keeps serving the deployed version. The preview is at:

https://pr-<number>-edgetx-lua-reference-guide.edgetx.workers.dev/<version>/

  • The PR is built as the version its base branch publishes (main → dev, edgetx_2.12 → 2.12/latest), on top of the current gh-pages tree. The preview is the whole site with that one version replaced, so the version switcher, banners and the other versions all work. Nothing gets pushed to gh-pages.
  • Upload uses wrangler versions upload --preview-alias pr-<n>. Each push to the PR updates the same alias.
  • The bot comments the preview link on the PR and edits that comment on later pushes.
  • Same-repo PRs only. Fork PRs don't get the Cloudflare secrets, and running a fork's build with the token available would be unsafe anyway. To preview fork PRs later, the usual approach is to build in pull_request with no secrets, then upload the static artifact from a separate workflow_run job.

Preview URLs are already turned on for the Worker in the dashboard.

Notes

Testing

This PR is a same-repo PR into edgetx_2.12, so the workflow runs on this PR itself. The preview comment below is the test.

🤖 Generated with Claude Code

Builds the PR as the version its base branch publishes, on top of the
current gh-pages tree, and uploads it with `wrangler versions upload
--preview-alias pr-<n>`, so production is untouched. A bot comment on the
PR links the preview. Same-repo PRs only, since fork PRs don't get the
Cloudflare secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview: https://pr-19-edgetx-lua-reference-guide.edgetx.workers.dev/2.12/

Built from f2dbec0 as the 2.12 version, on top of the currently published site.

@pfeerick

Copy link
Copy Markdown
Member Author

Superseded by #31, which adds a generic preview workflow for main and all edgetx_* branches.

@pfeerick pfeerick closed this Oct 23, 2026
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