A ready-to-use CI/CD Pipeline for deploying your applications to Cloudflare Workers / Cloudflare Pages.
Run the following command:
fluentci run cloudflare_pipeline
Use as a Dagger Module:
dagger install github.com/fluent-ci-templates/cloudflare-pipeline@main
Call functions from the module:
# Deploy to Cloudflare Workers
dagger call deploy --src . \
--api-token CF_API_TOKEN \
--account-id $CF_ACCOUNT_ID \
--project-name $PROJECT_NAME
# Deploy to Cloudflare Pages
dagger call pages-deploy --src . \
--api-token CF_API_TOKEN \
--account-id $CF_ACCOUNT_ID \
--directory dist \
--project-name $PROJECT_NAME
Variable | Description |
---|---|
CLOUDFLARE_API_TOKEN | Your Cloudflare API Token. |
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare Account ID. |
DIRECTORY | The directory to deploy to Cloudflare Pages. Defaults to . |
PROJECT_NAME | The name of your project. |
Job | Description |
---|---|
deploy | Deploys your Worker to Cloudflare. |
pagesDeploy | Deploy a directory of static assets as a Pages deployment. |
pagesDeploy(
src: string | Directory,
apiToken: string | Secret,
accountId: string,
directory: string,
projectName: string,
): Promise<string>
deploy(
src: string | Directory,
apiToken: string | Secret,
accountId: string
): Promise<string>
You can also use this pipeline programmatically:
import { deploy } from "jsr:@fluentci/cloudflare";
await deploy(
".",
Deno.env.get("CLOUDFLARE_API_TOKEN")!,
Deno.env.get("CLOUDFLARE_ACCOUNT_ID")!
);