GitHub Action
The Massdriver GitHub Actions publish bundles and deploy instances from a workflow. example_workflows/ has starter workflows for bundle publishing, image build and deploy, and GitOps-style deploys.
| Action | Does |
|---|---|
massdriver-cloud/actions/setup@v6 | Installs the mass CLI. The tag input pins a release, 2.0.0 or later. |
massdriver-cloud/actions/bundle_build@v6 | Builds the bundle's schemas from massdriver.yaml. |
massdriver-cloud/actions/bundle_publish@v6 | Publishes the bundle in bundle-directory to its repository. |
massdriver-cloud/actions/instance_deploy@v6 | Deploys the instance of a project, environment and component. |
The actions run on Node 24. Self-hosted runners need actions/runner v2.327.0 or later. To upgrade from v5, where app_patch, app_deploy and image_push were separate actions, see the migration guide.
You need:
- A Massdriver service account in a group that can publish to the bundle's repository and deploy the instance.
- A GitHub repository with the application code or the bundle.
Credentials​
Set these in the repository:
| Name | Type | Value |
|---|---|---|
MASSDRIVER_ORG_ID | secret or variable | Your organization ID |
MASSDRIVER_API_KEY | secret | The service account secret |
A self-hosted installation also needs MASSDRIVER_URL, the URL of its API.
Deploy an application​
Publish the application and add it to the project once by hand. Follow Create an Application, then drag the application from the bundle bar onto the canvas, fill in its fields, and click Save.
This workflow builds and pushes an image, publishes the bundle, and deploys the instance with the new image tag. To push to ECR, Artifact Registry, ACR or GHCR, replace the Docker Hub login with that registry's login action.
name: Deploy to Massdriver
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
env:
MASSDRIVER_ORG_ID: ${{ secrets.MASSDRIVER_ORG_ID }}
MASSDRIVER_API_KEY: ${{ secrets.MASSDRIVER_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: my-org/my-app:${{ github.sha }}
- name: Install Massdriver CLI
uses: massdriver-cloud/actions/setup@v6
- name: Publish bundle
uses: massdriver-cloud/actions/bundle_publish@v6
with:
bundle-directory: ./massdriver
- name: Deploy instance
uses: massdriver-cloud/actions/instance_deploy@v6
with:
project: inventory
environment: staging
component: api
patch: |
.image.tag = "${{ github.sha }}"
instance_deploy inputs:
| Input | Value |
|---|---|
project, environment, component | The three parts of the instance ID. For inventory-staging-api, they are inventory, staging and api. The instance ID is on the instance's Overview tab. |
patch | One or more jq expressions, one per line, applied to the last deployed configuration. |
params | A json, yaml, tfvars or toml file that replaces the whole configuration. Do not set both patch and params. |
message | A message shown on the deployment in Massdriver. |

The path in patch is the path to the field in the bundle's params. For this params section of massdriver.yaml, the path to the tag is .image.tag:
params:
required:
- image
properties:
image:
type: object
title: Container Image
required:
- tag
properties:
tag:
title: Image tag
type: string
default: latest
Publish a bundle​
Publish the bundle and add it to a project once by hand. Follow Creating Bundles.
name: Publish to Massdriver
on:
push:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
env:
MASSDRIVER_ORG_ID: ${{ secrets.MASSDRIVER_ORG_ID }}
MASSDRIVER_API_KEY: ${{ secrets.MASSDRIVER_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: Install Massdriver CLI
uses: massdriver-cloud/actions/setup@v6
- name: Publish bundle
uses: massdriver-cloud/actions/bundle_publish@v6
with:
bundle-directory: ./
bundle_publish inputs:
| Input | Default | Value |
|---|---|---|
bundle-directory | . | The directory that contains massdriver.yaml. |
development | false | Publish a development release with a generated version suffix, for example from pull requests. |
skip-lint | false | Skip linting before publishing. |
fail-warnings | false | Fail when linting reports warnings. |
A published version cannot change, except 0.0.0. The action skips publishing when no file in bundle-directory changed.
Both workflows run on pushes to main. Change the trigger to match your branching.
Preview environments​
For a preview environment for each pull request, run mass environment preview in a job. One YAML file sets the fork, environment defaults, per-instance overrides, and the deploy.