
Dagger Has a Free API: CI/CD Pipelines as Code That Run Anywhere
Why Dagger Dagger lets you write CI/CD pipelines in Go, Python, or TypeScript — not YAML. Run them locally for testing, then use the same code in GitHub Actions, GitLab CI, or any CI system. Install curl -fsSL https://dl.dagger.io/dagger/install.sh | sh Pipeline in TypeScript import { dag , Container , Directory , object , func } from ' @dagger.io/dagger ' ; @ object () class MyPipeline { @ func () async build ( src : Directory ): Promise < Container > { return dag . container () . from ( ' node:20-alpine ' ) . withDirectory ( ' /app ' , src ) . withWorkdir ( ' /app ' ) . withExec ([ ' npm ' , ' ci ' ]) . withExec ([ ' npm ' , ' run ' , ' build ' ]); } @ func () async test ( src : Directory ): Promise < string > { return ( await this . build ( src )) . withExec ([ ' npm ' , ' test ' ]) . stdout (); } @ func () async publish ( src : Directory , tag : string ): Promise < string > { return ( await this . build ( src )) . publish ( `ghcr.io/myorg/myapp: ${ tag } ` ); } } # Run locally dagg
Continue reading on Dev.to Python
Opens in a new tab

