A practical guide to deploying only changed apps from a pnpm/npm monorepo to Cloudflare Pages using Nx's affected command and GitHub Actions. The approach uses Nx's project graph to dynamically detect which apps changed (including transitive dependencies), declares a `deploy` target per app in package.json with wrangler, and runs a single `nx affected -t deploy` command in CI. Key details covered include the `dependsOn: ["build"]` pipeline, disabling task caching for deploy targets, setting the base SHA with `nx-set-shas`, and configuring branch-based preview URLs on Cloudflare Pages.

5m read timeFrom nx.dev
Post cover image
Table of contents
Two paths for deployingThe deploy targetThe workflowSecrets and one-time setupWrapping upLearn More

Sort: