Skip to main content
Deno 2 is finally here 🎉️
Learn more

Cloudflare Pipeline

fluentci pipeline deno module deno compatibility

A ready-to-use CI/CD Pipeline for deploying your Cloudflare Workers to Cloudflare.

🚀 Usage

Run the following command:

fluentci run cloudflare_pipeline

Dagger Module

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 . \
  --apiToken $CF_API_TOKEN \
  --account-id $CF_ACCOUNT_ID \
  --project-name $PROJECT_NAME

# Deploy to Cloudflare Pages
dagger call pages-deploy --src . \
  --apiToken $CF_API_TOKEN \
  --account-id $CF_ACCOUNT_ID \
  --directory dist \
  --project-name $PROJECT_NAME

Environment Variables

Variable Description
CF_API_TOKEN Your Cloudflare API Token.
CF_ACCOUNT_ID Your Cloudflare Account ID.
DIRECTORY The directory to deploy to Cloudflare Pages. Defaults to .
PROJECT_NAME The name of your project.

Jobs

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>

Programmatic usage

You can also use this pipeline programmatically:

import { deploy } from "https://pkg.fluentci.io/cloudflare_pipeline@v0.7.4/mod.ts";

await deploy(
  ".", 
  Deno.env.get("CF_API_TOKEN")!, 
  Deno.env.get("CF_ACCOUNT_ID")!
);