Cloudflare
Deploy Explainer apps to Cloudflare Pages using GitHub Actions with the cloudflare/wrangler-action.
Setup
Set the deploy target
Add a repository variable in GitHub Settings → Variables:
DEPLOY_TARGET=cloudflare Add required secrets
Add the following secrets in GitHub Settings → Secrets:
| Secret | Description |
|---|---|
CLOUDFLARE_API_TOKEN | Cloudflare API token with Pages permissions |
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID |
Create Cloudflare Pages projects
Create a Pages project in the Cloudflare dashboard for each app you want to deploy (e.g., explainer-docs, explainer-blog).
GitHub Actions workflow
The unified workflow at .github/workflows/deploy.yml handles all three apps. When DEPLOY_TARGET is set to cloudflare, the deploy job uses the wrangler action:
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=explainer-docs
Replace explainer-docs with your Cloudflare Pages project name. Each app needs its own project. See the CI/CD page for the full workflow structure.