Deploying Flutter Web builds to Cloudflare Pages

Hero background

Recently I've had to figure out a way to build a Flutter Web project, and get it deployed to Cloudflare Pages.

Given that the thing I'm building is likely to be multi-tenanted, and with multiple versions on the go, I would prefer to not rely on a single `main` branch for my deployments. Instead I'd like a branch identifying the customer and its application version to be deployed.

Using the following Makefile you can easily connect your Cloudflare Pages project to your Flutter deployment.

Make sure you connect the Pages project to your Github repository, then set `target/` as the root folder of the deployment.

To use the Makefile run it as follows:

$ make build -e RELEASE_BRANCH=customer-name -e BUILD_VERSION=1.1.0