ci: replace Fleek deployment with Cloudflare Pages direct upload - #189
Conversation
The committed workflows still deployed to Fleek, while the live sites are the Cloudflare Pages projects boson-widgets-testing, boson-widgets-staging and boson-widgets, fed by Cloudflare's Git integration off main, deploy/staging and deploy/production. Build settings and env vars for those lived in the Cloudflare dashboard: undiffable and invisible to code review. The last release deploy (v0.0.50) failed outright. Build in GitHub Actions and upload with wrangler (Direct Upload). Because every REACT_APP_* is inlined at build time by CRA, Cloudflare no longer needs to build anything, so its dashboard build settings and env vars become irrelevant rather than merely duplicated. Non-secret configuration stays committed in deploy_reusable.yaml, where it is diffable and reviewed alongside the code that reads it. Only secrets move into the testing/staging/production GitHub Environments, which drops the _STAGING/_PRODUCTION name suffixes: GitHub resolves the environment's value and falls back to the repository-level one. Deploy triggers: preview every PR, published at pr-<n>.boson-widgets-testing.pages.dev testing push to main, gated on the CI checks staging release published, builds that tag production manual dispatch with a tag Incidental fixes: - Preflight check for the values a deployment cannot work without. src/config.ts throws at module load for ~10 REACT_APP_* variables, and CRA only compiles that file rather than executing it, so a missing value currently builds green, uploads green and serves a blank page. - Non-mutating gates. npm run prettier and npm run lint are --write/--fix, so as CI steps they gated nothing and left the build compiling something other than the committed code. Added prettier:check, lint:check and tsc, and run them first. All three pass clean on the current tree. - There was no testing deploy in CI at all, and PRs built with REACT_APP_ENV_NAME=staging but deployed nothing. - Node pinning: CI said 24, volta said 22.14.0, docs said 16.X. Collapsed onto .nvmrc (24, the version CI has actually been shipping with). - Dropped @fleek-platform/cli, which took its AWS SDK tree with it. Verified locally: npm ci from the regenerated lockfile, prettier:check, lint:check and tsc all clean; actionlint clean across all workflows; a build with the workflow's exact testing values produces a 22M bundle with no file near Cloudflare's 25 MiB limit and no source maps, every REACT_APP_* substituted (no process.env.REACT_APP_* literals survive); served headless, #/dev, #/redeem and #/finance all render with no config.ts throw. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Preview deployment
Built from 63f8a7c against the |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes production deployment workflows and depends on external GitHub Environment/Cloudflare configuration that can’t be validated from the diff alone.
Pull request overview
This PR migrates the repo’s GitHub Actions deployment path from Fleek to Cloudflare Pages “Direct Upload” via wrangler, making builds fully GitHub-driven and reducing reliance on Cloudflare dashboard build configuration.
Changes:
- Adds reusable build+deploy workflow plus environment-specific deploy workflows for preview/testing/staging/production Cloudflare Pages uploads.
- Replaces the previous CI workflow structure with a single CI workflow that runs non-mutating format/lint/type checks (and only builds for fork PRs), and is callable to gate testing deploys.
- Aligns Node usage via
.nvmrc, addstsc,lint:check,prettier:checkscripts, and removes Fleek tooling/config.
File summaries
| File | Description |
|---|---|
| README.md | Documents new Cloudflare Pages environments, triggers, and configuration ownership. |
| package.json | Adds non-mutating check scripts (prettier:check, lint:check) and tsc; removes Volta config and Fleek CLI. |
| package-lock.json | Regenerates lockfile reflecting removed Fleek dependency tree and related dependency graph changes. |
| docs/local-development.md | Updates local dev prerequisites and adds a “Checks” section matching CI commands. |
| .nvmrc | Introduces a single source of truth for Node version selection. |
| .github/workflows/deploy-testing.yaml | Deploys to testing on main pushes, gated by CI via workflow_call. |
| .github/workflows/deploy-staging.yaml | Deploys tagged releases to staging on release published. |
| .github/workflows/deploy-production.yaml | Adds manual production deploy-by-tag with tag existence verification. |
| .github/workflows/deploy-preview.yaml | Adds PR preview deployments (non-forks) and posts a sticky PR comment with URLs. |
| .github/workflows/deploy_reusable.yaml | Implements the shared build + required-config preflight + Cloudflare Pages upload + smoke check. |
| .github/workflows/ci.yaml | Replaces legacy CI with a single “CI - Widgets” workflow usable by PRs and as a callable gate. |
| .github/workflows/ci_reusable.yaml | Removes the old Fleek-oriented reusable workflow. |
| .github/actions/setup-node-npm/action.yml | Adds a composite action to standardize Node setup from .nvmrc with npm caching. |
| .fleek.json | Removes Fleek site config. |
| .fleek_staging.json | Removes Fleek staging config. |
| .fleek_production.json | Removes Fleek production config. |
Review details
- Files reviewed: 15/16 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
First run: green, end to end ✅The
Behavioural check against the deployed preview. Loaded The same check run against the current Remaining setup
Disconnect Cloudflare's Git integration only after a push-to- |
The comment claimed the list mirrors the non-optional entries of the EnvVariables array in src/config.ts, but six of its sixteen entries are not that: - REACT_APP_META_TX_API_KEY_MAP and _IDS_MAP are `optional: true` in src/config.ts; they are required here because their absence silently disables gasless transactions rather than throwing. - REACT_APP_MAGIC_API_KEY and REACT_APP_INFURA_KEY appear nowhere in src/ - they are read by @bosonprotocol/react-kit and inlined by CRA's DefinePlugin. - CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID are not app config at all. Anyone syncing the list against src/config.ts on the strength of that sentence would have deleted the six. Spell out the four categories and state the rule that actually holds: a new non-optional EnvVariables entry belongs here, but the converse does not follow. Comment-only; no behaviour change. Addresses PR #189 review comment r3956316507. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…on 0.43.0-alpha.0 feat: replace IPFS project ID and secret with JWT in Commit and Redeem components refactor: update config to include ipfsJwt and ipfsGatewayToken
Replicates interface#1181 for this repo.
Why
The committed workflows still deploy to Fleek, while the live sites are the Cloudflare Pages projects
boson-widgets-testing,boson-widgets-stagingandboson-widgets, fed by Cloudflare's Git integration offmain,deploy/staginganddeploy/production. Build settings and env vars for those live in the Cloudflare dashboard: undiffable and invisible to code review. The last release deploy (v0.0.50, Feb 2026) failed outright.What changes
Build in GitHub Actions and upload with
wrangler(Direct Upload). Because everyREACT_APP_*is inlined at build time by CRA, Cloudflare no longer needs to build anything — so its dashboard build settings and env vars become irrelevant, not merely duplicated.Where configuration lives
Unlike interface#1181, which moved ~30 values into GitHub variables, the non-secret values here stay committed in
deploy_reusable.yaml— the IPFS gateway, theipfs://templates, the dispute periods and the per-environment dApp/DR-Center URLs. They were already inci_reusable.yaml, where they are diffable and reviewed alongside the code that reads them; moving them into a dashboard-like store would be a regression against the very thing that PR was fixing.Only secrets move into the
testing/staging/productionGitHub Environments. That drops the_STAGING/_PRODUCTIONname suffixes: GitHub resolves the environment's value and falls back to the repository-level one.This repo stays on npm. No pnpm migration — that is not part of the deployment change.
Deploy triggers
pr-<n>.boson-widgets-testing.pages.dev, posted as a sticky commentmainboson-widgets-testing.pages.dev, gated on the CI checksboson-widgets-staging.pages.dev, builds that tagwidgets.bosonprotocol.io, builds that tagpublishedrather thancreated:createddoes not fire when a release is published from a draft, which is one way the old workflow could silently skip a deploy.Incidental fixes
src/config.tsthrows at module load for ~10REACT_APP_*variables, and CRA only compiles that file rather than executing it — so a missing value currently builds green, uploads green and serves a blank page. This is the single most valuable step in the PR, and it matters more here than ininterface, whoseconfig.tsthrows on only three.npm run prettierandnpm run lintare--write/--fix, so as CI steps they gated nothing and left the build compiling something other than the committed code. Addedprettier:check,lint:checkandtsc, run first. All three pass clean on the current tree.REACT_APP_ENV_NAME=stagingbut deployed nothing.voltasaid 22.14.0,docs/local-development.mdsaid 16.X. Collapsed onto.nvmrc(24, the version CI has actually been shipping with).@fleek-platform/cli, which took its AWS SDK tree with it (−3270 lockfile lines).Verification done locally
npm cifrom the regenerated lockfile;prettier:check,lint:check,tsc— all clean.actionlint— clean across all workflows.npm run buildwith the workflow's exacttestingvalues: 22M bundle, no file near Cloudflare's 25 MiB limit, no source maps, and noprocess.env.REACT_APP_*literals survive — confirming the values reach@bosonprotocol/react-kittoo, not justsrc/.build/headless:#/dev,#/redeemand#/financeall render with noconfig.tsthrow.#/redeemshows the app's ownMissing 'configId' query parammessage, i.e. the bundle is live, not blank.Repository secrets — add
CLOUDFLARE_API_TOKEN(scope: Cloudflare Pages → Edit) andCLOUDFLARE_ACCOUNT_ID. KeepREACT_APP_INFURA_IPFS_PROJECT_ID/_SECRETand bothREACT_APP_META_TX_*repository variables as they are.Three GitHub Environments — none exist today. Each needs a
CF_PROJECTvariable and three secrets:testingstagingproductionCF_PROJECTboson-widgets-testingboson-widgets-stagingboson-widgetsREACT_APP_INFURA_KEY..._STAGING..._PRODUCTIONREACT_APP_MAGIC_API_KEY..._STAGING..._PRODUCTIONREACT_APP_WALLET_CONNECT_PROJECT_ID..._STAGING..._PRODUCTIONThe repo has no
_TESTINGsecrets — CI has never built a testing bundle. Take those three from theboson-widgets-testingCloudflare project's current environment variables, or reuse the staging values if they are shared.Check each project's production branch with
wrangler pages project list. A--branchthat does not equal the project's production branch lands as a Preview deployment and the live URL keeps serving the old build.boson-widgets-stagingandboson-widgetswere Git-connected todeploy/staging/deploy/production, so their production branch is very likely notmain— either change it in the dashboard or changecf_branchindeploy-staging.yaml/deploy-production.yaml. Please confirm this before merging.Then, in this order: merge → confirm a testing deploy → only then disconnect Cloudflare's Git integration on all three projects, so there is never a window without a working deploy path. Once staging and production have each deployed once through the new flow, delete the
deploy/staginganddeploy/productionbranches and the now-unusedFLEEK_API_KEY,FLEEK_TOKEN,FLEEK_PROJECT_IDand_STAGING/_PRODUCTION-suffixed secrets.Branch protection on
mainshould require the Format, lint, types and build job of CI - Widgets. Required checks match by name, so renaming the workflow or job detaches the rule silently.Known trade-off
PR previews use the
testingEnvironment to avoid duplicating secrets, so preview deployments appear in that environment's history alongside real testing deploys. A separatepreviewEnvironment would separate them at the cost of a second copy of the values.🤖 Generated with Claude Code