Using GitHub repositories in CodeCatalyst workflows - Amazon CodeCatalyst

Using GitHub repositories in CodeCatalyst workflows

You can use a linked GitHub repository as the source for a workflow, where changes to a specified branch in a linked GitHub repository automatically start a workflow run.

A workflow is an automated procedure that describes how to build, test, and deploy your code as part of a continuous integration and continuous delivery (CI/CD) system. A workflow defines a series of steps, or actions, to take during a workflow run. A workflow also defines the events, or triggers, that cause the workflow to start. To set up a workflow, you create a workflow definition file using the CodeCatalyst console's visual or YAML editor.

Tip

For a quick look at how you might use workflows in a project, create a project with a blueprint. Each blueprint deploys a functioning workflow that you can review, run, and experiment with.

When you configure a workflow to use a linked GitHub repository, the workflow configuration file is stored in that GitHub repository. The workflow configuration is a YAML file that defines the workflow name, triggers, resources, artifacts, and actions. For more information about the workflow configuration file, see Workflow definition reference.

The workflow configuration file must be in the ./codecatalyst/workflows/ directory in your GitHub repository.

You can use the workflow editor to create and configure workflows. For more information see Getting started with workflows in CodeCatalyst and Working with sources.

Automatically start a workflow run after GitHub repository events

You can configure a CodeCatalyst workflow to automatically start a run when code is pushed to the specified branch of your GitHub repository. To start a workflow run automatically, add a trigger to the Triggers section of the workflow configuration file. The following snippet will start a workflow run whenever code is pushed to the main branch of your GitHub repository.

Triggers: - Type: PUSH Branches: - main
Note

CodeCatalyst workflow runs can't be started automatically based on pull request events in GitHub. A workflow configured to run when code is pushed to your GitHub repository will run when a pull request is merged to the specified branch.

For more information, see Working with triggers.