https://github.com/fluent-ci-templates/cloudflare-pipeline
A ready-to-use CI/CD Pipeline for deploying your Cloudflare Workers .
https://github.com/fluent-ci-templates/cloudflare-pipeline
cicd cloudflare-workers dagger deno pipeline typescript
Last synced: 3 months ago
JSON representation
A ready-to-use CI/CD Pipeline for deploying your Cloudflare Workers .
- Host: GitHub
- URL: https://github.com/fluent-ci-templates/cloudflare-pipeline
- Owner: fluent-ci-templates
- License: mit
- Created: 2023-07-29T18:02:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-11T15:27:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T21:14:09.884Z (over 1 year ago)
- Topics: cicd, cloudflare-workers, dagger, deno, pipeline, typescript
- Language: TypeScript
- Homepage:
- Size: 194 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Cloudflare Pipeline
[](https://pkg.fluentci.io/cloudflare_pipeline)
[](https://deno.land/x/cloudflare_pipeline)

[](https://dagger.io)
[](https://jsr.io/@fluentci/cloudflare)
[](https://codecov.io/gh/fluent-ci-templates/cloudflare-pipeline)
A ready-to-use CI/CD Pipeline for deploying your applications to [Cloudflare Workers](https://workers.cloudflare.com/) / [Cloudflare Pages](https://pages.cloudflare.com/).
## 🚀 Usage
Run the following command:
```bash
fluentci run cloudflare_pipeline
```
## 🧩 Dagger Module
Use as a [Dagger](https://dagger.io) Module:
```bash
dagger install github.com/fluent-ci-templates/cloudflare-pipeline@main
```
Call functions from the module:
```bash
# 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
```
## 🛠️ Environment Variables
| 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. |
## ✨ Jobs
| Job | Description |
|-------------|------------------------------------------------------------|
| deploy | Deploys your Worker to Cloudflare. |
| pagesDeploy | Deploy a directory of static assets as a Pages deployment. |
```typescript
pagesDeploy(
src: string | Directory,
apiToken: string | Secret,
accountId: string,
directory: string,
projectName: string,
): Promise
deploy(
src: string | Directory,
apiToken: string | Secret,
accountId: string
): Promise
```
## 👨💻 Programmatic usage
You can also use this pipeline programmatically:
```typescript
import { deploy } from "jsr:@fluentci/cloudflare";
await deploy(
".",
Deno.env.get("CLOUDFLARE_API_TOKEN")!,
Deno.env.get("CLOUDFLARE_ACCOUNT_ID")!
);
```