Triggering pipelines using GitHub Actions
GitHub Actions is a GitHub-based workflow automation platform. You can use the GitHub actions Trigger Buildkite Pipeline to trigger a build on a Buildkite pipeline.
The Trigger Buildkite Pipeline GitHub Action allows you to:
- Create builds in Buildkite pipelines and set
commit
,branch
,message
. - Save the build JSON response to
${HOME}/${GITHUB_ACTION}.json
for downstream actions.
Find the Trigger Buildkite Pipeline on GitHub Marketplace or follow this link directly.
Before you start
This tutorial assumes some familiarity with GitHub and using GitHub Actions. Learn more about GitHub Actions from their documentation.
Creating the workflow for Buildkite GitHub Actions
- If a workflow directory does not exist yet, create the
.github/workflows
directory in your repo to store the workflow files for Buildkite Pipeline Action. - Create a Buildkite API access token with
write_builds
scope, and save it to your GitHub repository’s Settings in Secrets. You can read more about Creating encrypted secrets for a repository in GitHub. - Define your GitHub Actions workflow with the details of the pipeline to be triggered. To ensure that the latest version is always used, click "Use latest version" on the Trigger Buildkite Pipeline page. Copy and paste the code snippet provided.
- Configure the workflow by setting the applicable configuration options.
Example workflow
The following workflow creates a new Buildkite build on every commit (change my-org/my-deploy-pipeline
to the slug of your org and pipeline, and TRIGGER_BK_BUILD_TOKEN
to the secrets env var you have defined):
Configuring the workflow
Refer to the action.yml for the input parameters required.
See Trigger-pipeline-action for more details, code, or to contribute to or raise an issue for the Buildkite GitHub Action.