Cloudflare
Deploy Explainer apps to Cloudflare Pages using GitHub Actions with the cloudflare/wrangler-action.
Setup
Set the deploy target
Add the following repository variables in GitHub Settings → Secrets and variables → Actions → Variables tab:
DEPLOY_TARGET=cloudflare
PROJECT_NAME=your-project-namePROJECT_NAME is used to name the Cloudflare Pages projects. For example, PROJECT_NAME=explainer produces explainer-docs, explainer-blog, and explainer-website.
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=${{ vars.PROJECT_NAME }}-docs
The project name is built from PROJECT_NAME + the app suffix (-docs, -blog, -website). Each app must have a matching project in the Cloudflare dashboard. See the CI/CD page for the full workflow structure.