BuildsGitHub Actions

GitHub Actions

Building and deploying straight from your repository with GitHub Actions is coming soon, and ships with the DevLyft CLI. Today, deploys start from a container image you push yourself.

What you can do today#

You can already use GitHub Actions to build and push your image, then create the DevLyft build from it. The two halves are separate: your workflow publishes the image, and you register it on DevLyft.

  1. Build and push the image in your workflow

    Any registry DevLyft can pull from works. This workflow pushes to GitHub Container Registry, tagged with the commit SHA:

    .github/workflows/image.yml
    name: image
    on:
      push:
        branches: [main]
    permissions:
      contents: read
      packages: write
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: docker/login-action@v3
            with:
              registry: ghcr.io
              username: ${{ github.actor }}
              password: ${{ secrets.GITHUB_TOKEN }}
          - uses: docker/build-push-action@v6
            with:
              push: true
              tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
  2. Create a build from the pushed tag

    In BuildsNew build, set Image to ghcr.io/<owner>/<repo> and Tag to the commit SHA. See Create a build.

  3. Point your deploy at the new build

    In Deployments, Edit the deploy, choose the new build under Build and choose Save deploy. See Update and redeploy.

Automating the DevLyft side#

Steps 2 and 3 can also be scripted from a workflow against the DevLyft API, using an API key stored as a GitHub secret: POST /v1/projects/{project_id}/builds creates the build, and PUT /v1/deploys/{deploy_id} repoints the deploy. See the API reference.

What's coming#

The GitHub Actions integration arrives with the DevLyft CLI. Its setup steps, permissions and workflow syntax will be documented here when it launches.