Dagger Github Actions

Dagger + GitHub Actions

ComeOnOliver Updated 61 repo stars

File contents

Dagger + GitHub Actions

.github/workflows/ci.yml

name: CI
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dagger/dagger-for-github@v6
        with:
          verb: run
          args: node pipeline.ts

Pipeline

import { connect } from "@dagger.io/dagger";
connect(async (client) => {
    const src = client.host().directory(".");
    const node = client.container().from("node:20")
        .withDirectory("/app", src).withWorkdir("/app")
        .withExec(["npm", "ci"]);

    await node.withExec(["npm", "test"]).sync();
    await node.withExec(["npm", "run", "build"]).sync();
});

Same pipeline runs locally (dagger run) and in CI

Built-in caching, no vendor lock-in

ComeOnOliver/skillshub/tree/main/skills/skillshub-team/catalog-batch5/dagger-github-actions commit 73653b5a27

Frequently asked questions

npx skillmds@latest add comeonoliver/dagger-github-actions