1. Resources
  2. /
  3. Blog
  4. /
  5. Announcing GitHub Deployments Support

Announcing GitHub Deployments Support

2 minute read

You can now easily use the GitHub Deployments API to trigger your Buildkite deployment pipelines 🚀

GitHub Deployment Builds

The GitHub Deployments API is designed to be used with your own deployment tool (such as hubot-deploy) and supports options such as required_contexts to validate that other services and Buildkite pipelines must have succeeded on a commit before allowing a deploy.

How deployments work with the GitHub API and your Buildkite project can be tough to wrap your head around at first, so here’s a look at the sequence of events that happen after you create a GitHub deployment using a tool such as hubot-deploy:

+--------------+ +--------+ +-----------+ +-----------------+ | hubot-deploy | | GitHub | | Buildkite | | Buildkite Agent | +--------------+ +--------+ +-----------+ +-----------------+ | | | | | Create Deployment | | | |--------------------->| | | | | | | Deployment Event | | |---------------------->| | | | Build Starts | | |-------------------->| | | | | Deployment Status | | |<----------------------| | | | | | | Build Finishes | | |<--------------------| | | | Deployment Status | |<----------------------|

A deployment build triggered from GitHub is the same as any other build, but has four additional environment variables:

1
2
3
4
BUILDKITE_GITHUB_DEPLOYMENT_ID="125875"
BUILDKITE_GITHUB_DEPLOYMENT_TASK="deploy"
BUILDKITE_GITHUB_DEPLOYMENT_ENVIRONMENT="production"
BUILDKITE_GITHUB_DEPLOYMENT_PAYLOAD="{\"user\":\"keithpitt\"}"

When a deployment build starts, a Deployment Status is created on the commit so you can see the build status, and link to the Buildkite build, right there in your pull request:

GitHub Deployment StatusNote that if the commit you’re deploying is outside of a pull request (such as a master commit, or a pull request merge commit) it currently won’t appear anywhere in GitHub’s web interface. It still works, it’s just not visible.

Buildkite supports having multiple projects with the same GitHub repository, and we recommend you take advantage of this to set up a separate deployment project. A separate deployment project gives you visibility and control of your deployment builds separate to your regular test and CI builds.

If you’re looking to use GitHub to control and track your deployments we hope this new integration adds more ✨ to your deployments! :shipit:


Related posts

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML

Support

  1. System status
  2. Forum