Define CI/CD workflows using TypeScript with PandaCI
import { docker, $ } from "@pandaci/workflow";
docker("ubuntu:latest", async () => {
await $`echo "Hello, World!"`;
});website·Indexed 31 days ago
https://pandaci.comA CI/CD platform that uses TypeScript for defining workflows. Documentation covers the platform's core concepts including runners, secrets, and workflow environments, as well as TypeScript syntax for configuring jobs, Docker tasks, exec steps, and workflow triggers. Includes guides for installing packages, sending Slack notifications, and setting up CI/CD for Node.js and Python projects.
import { docker, $ } from "@pandaci/workflow";
docker("ubuntu:latest", async () => {
await $`echo "Hello, World!"`;
});PandaCI uses a tiered execution model to build and test code:
$ tagged template literal and returns a promise that resolves when the command completes. Commands are automatically escaped to prevent command injection.import { docker, $ } from "jsr:@pandaci/workflow";
docker("ubuntu:latest", () => {
$`echo "Hello, world!"`;
const output = $`ls`.text();
});slack npm package.PandaCI allows unlimited organization members on all plans. To invite a team member, navigate to the Members page within your organization and click the Invite Member button located in the top right corner.
.workflow.ts extension inside the .pandaci directory. PandaCI uses Deno to execute these workflows. You can create multiple workflow files within the .pandaci directory to organize your project.// Example file path: .pandaci/hello-world.workflow.ts
import { docker, $, job, env } from "jsr:@pandaci/workflow";
// Define a docker task on a 4-core machine
docker("ubuntu:latest", { name: "hello world" }, () => {
// Runs a shell command using the $ template literal
$`echo "Hello, world! from branch: ${env.PANDACI_BRANCH}"`;
});
// Define a job with a specific runner
job("Job 2", { runner: "ubuntu-2x" }, async () => {
let files = '';
await docker("ubuntu:latest", async () => {
// Run command in a specific directory and capture output as text
files = await $`ls`.cwd(".pandaci").text();
});
docker("ubuntu:latest", () => {
// Share data between tasks or jobs
$`echo "files from another task: ${files}"`;
});
});nodemailer npm package.import { job } from "jsr:@pandaci/workflow"
// Simple job (uses default ubuntu-4x runner)
await job("A very cool job", () => {
// ...
})
// Job with a custom runner
await job("A very cool job", { runner: "ubuntu-8x" }, () => {
// ...
})To send notifications from PandaCI, you must create a Slack app with the chat:write bot permission.
chat:write scope (or use the provided manifest).SLACK_BOT_TOKEN.SLACK_CHANNEL_ID.{
"_metadata": {
"major_version": 1,
"minor_version": 1
},
"display_information": {
"name": "PandaCI Slack App",
"description": "Sends workflow notifications from the greatest CI/CD platform"
},
"features": {
"bot_user": {
"display_name": "PandaCI Bot",
"always_online": true
},
"app_home": {
"home_tab_enabled": false
}
},
"oauth_config": {
"scopes": {
"bot": [
"chat:write"
]
}
}
}$ function without a string or by passing a configuration object. This is useful for setting a consistent working directory across multiple commands.// Using .cwd() method
const buildExec = $.cwd("./build");
buildExec`ls`;
// Using configuration object
const testExec = $({ cwd: "./test" });
testExec`ls`;