Prerequisites Link to heading
- Flutter project
- Github Account
- Cloudflare account
Steps Link to heading
- Create the GitHub Actions Workflow
- Create .github/workflows/deploy-to-cloudflare.yml in your repository root
- e.g. https://github.com/RandX829/Flutter-Cloudflare/blob/main/.github/workflows/deploy-to-cloudflare.yml
- Create a Cloudflare Pages project
- e.g. npx wrangler pages project create your-pages-project-name –production-branch main
- Add GitHub secrets
- Go to Settings > Secrets and variables > Actions
- CLOUDFLARE_API_TOKEN
- Go to dash.cloudflare.com > Profile > API Tokens > Create Token
- Edit Cloudflare Workers > Use Template
- Permissions: Account > Cloudflare Pages > Edit
- Account Resources: Select an account
- Create & Copy
- CLOUDFLARE_ACCOUNT_ID
- Can find it in the URL
- e.g. https://dash.cloudflare.com/CLOUDFLARE_ACCOUNT_ID/home
- Commit and Trigger the Workflow
- Custom Domain (Optional)