Skip to main content

Integrating with your CI environment

Dagger can be used with any CI environment (no migration required) and has two important advantages which make the overall experience less error-prone and more efficient:

  1. You don't write YAML, you write CUE - typed configuration with built-in formatting
  2. Configuration is executed in BuildKit, the execution engine at the heart of Docker

This makes any CI environment with Docker pre-installed work with Dagger out of the box. We started with CI environments that you told us you are using. We will configure a production deployment for the same application that we covered in the previous page.

note

If you cannot find your CI environment below, let us know via this GitHub discussion.

.github/workflows/todoapp.yml
name: todoapp

on:
push:
# Trigger this workflow only on commits pushed to the main branch
branches:
- main

# Dagger plan gets configured via client environment variables
env:
# This needs to be unique across all of netlify.app
APP_NAME: todoapp-dagger-europa
NETLIFY_TEAM: dagger

jobs:
dagger:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

# You need to run `dagger project init` locally before and commit the cue.mod directory to the repository with its contents
- name: Deploy to Netlify
uses: dagger/dagger-for-github@v3
# See all options at https://github.com/dagger/dagger-for-github
with:
version: 0.2
# To pin external dependencies, you can use `project update github.com/[package-source]@v[n]`
cmds: |
project update
do deploy
env:
# Get one from https://app.netlify.com/user/applications/personal
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}