Github Actions Workflow Configuration

In order for Atmos Pro to be able to dispatch your Github Actions workflows, you will need to make some small changes to your workflow. This section will walk you through how to update your Github Actions Workflow configuration.


This section assumes you are familiar with Github Actions workflows and have already been using them in your organization. If you are new to Github Actions, please refer to the Github Actions documentation for more information.

Updates to your Github Actions Workflow

In order for Atmos Pro to be able to dispatch your Github Actions workflows, you will need to make some small changes to your workflow. The following is a list of the changes you will need to make.

Update the on trigger

The first change you will need to make is to update the on trigger to include the workflow_dispatch event. This will allow Atmos Pro to manually trigger the workflow from the Github Actions UI.

on:
  workflow_dispatch:

Update the inputs section to include the required inputs.

Next, you will need to update the inputs section to include the required inputs. The inputs include two required inputs plus the inputs that you specified in the Atmos Pro configuration. if the inputs do not match the required inputs or the inputs you specified in the Atmos Pro configuration, GitHub will throw an error when we try to dispatch the workflow.

on:
  workflow_dispatch:
    inputs:
      atmos_pro_run_id:
        description: "Atmos Pro Run ID"
        type: string
      sha:
        description: "Commit SHA"
        type: string
      component:
        description: "Component"
        required: true
        type: string
      stack:
        description: "Stack"
        required: true
        type: string
  • atmos_pro_run_id: This is a required input for every Atmos Pro workflow. It is used to identify the workflow run that was dispatched by Atmos Pro. We need to track this in this manner because the GitHub API triggers workflow runs in an asynchronous manner and doesn't return a workflow_run_id to us when we call the API. This means that we can't rely on the github.event.workflow_run.id to identify the workflow run that was triggered so we need to create our own unique identifier.
  • sha: This is also a required input for every Atmos Pro workflow. Since we are using workflow_dispatch as the method for running workflows, we don't have the github.event.pull_request.sha or similar Github context to determine the SHA that should be checked out to run our workflow against, so Atmos Pro always passes the commit SHA which triggered the event as an input.

Summary

Now that you have signed up for Atmos Pro and installed the Atmos Pro GitHub App, configured your Atmos repository, and configured your Github Actions workflow, you are ready to start using Atmos Pro to deploy your Atmos stacks!


Cloud Posse Atmos Pro Logo

Copyright ©2024 Cloud Posse, LLC. All rights reserved.