Skip to content

A ready-to-use CI/CD Pipeline and jobs for Deno projects.

License

Notifications You must be signed in to change notification settings

fluent-ci-templates/deno-pipeline

Repository files navigation

Deno Pipeline

fluentci pipeline deno module deno compatibility dagger-min-version ci

A ready-to-use CI/CD Pipeline for your Deno projects.

Made with VHS

🚀 Usage

Run the following command:

fluentci run deno_pipeline

Or, if you want to use it as a template:

fluentci init -t deno

This will create a .fluentci folder in your project.

Now you can run the pipeline with:

fluentci run .

🧩 Dagger Module

Use as a Dagger module:

dagger install github.com/fluent-ci-templates/deno-pipeline@main

Call functions from the module:

# Format
dagger call fmt --src .

# Lint
dagger call lint --src .

# Test
dagger call test --src . 

# Compile
dagger call compile --src . \
  --file main.ts \
  --output-binary main \
  --target x86_64-unknown-linux-gnu

# Deploy
dagger call deploy --src . \
  --token DENO_DEPLOY_TOKEN \
  --project $DENO_PROJECT \
  --main main.tsx \
  --no-static false

🛠️ Environment variables (Deno Deploy)

Variable Description Default
DENO_PROJECT Your project name
NO_STATIC Disable static assets false
EXCLUDE Exclude files from deploy
DENO_DEPLOY_TOKEN Your Deno Deploy token
DENO_MAIN_SCRIPT Your main script main.tsx
DENO_VERSION Set Deno version to use 1.44.0

✨ Jobs

Job Description Options
fmt Format your code
lint Lint your code
test Run your tests { ignore: string[] }
compile Compile the given script into a self contained executable
deploy Deploy your app to Deno Deploy
lint(
  src: string | Directory | undefined = "."
): Promise<Directory | string>

fmt(
  src: string | Directory | undefined = "."
): Promise<Directory | string>

test(
  src: string | Directory | undefined = ".",
  ignore: string[] = []
): Promise<File | string>

compile(
  src: string | Directory | undefined = ".",
  file = "main.ts",
  output = "main",
  target = "x86_64-unknown-linux-gnu"
): Promise<File | string>

deploy(
  src: string | Directory | undefined = ".",
  token?: string | Secret,
  project?: string,
  main?: string,
  noStatic?: boolean,
  excludeOpt?: string
): Promise<string>

👨‍💻 Programmatic usage

You can also use this pipeline programmatically:

import { fmt, lint, test } from "jsr:@fluentci/deno";

await fmt();
await lint();
await test();