Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-11T15:27:32.000Z (5 months ago)
- Last Synced: 2024-08-11T16:43:06.205Z (5 months 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
[![fluentci pipeline](https://shield.fluentci.io/x/cloudflare_pipeline)](https://pkg.fluentci.io/cloudflare_pipeline)
[![deno module](https://shield.deno.dev/x/cloudflare_pipeline)](https://deno.land/x/cloudflare_pipeline)
![deno compatibility](https://shield.deno.dev/deno/^1.41)
[![dagger-min-version](https://shield.fluentci.io/dagger/v0.11.7)](https://dagger.io)
[![](https://jsr.io/badges/@fluentci/cloudflare)](https://jsr.io/@fluentci/cloudflare)
[![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/cloudflare-pipeline)](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,
): Promisedeploy(
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")!
);
```