Skip to main content

GitHub Actions Pipeline

The pipeline will automate provisioning and updating the core infrastructure in AWS. This page assumes you have already completed the steps on the core infrastructure page.

The AWS infrastructure source code can be found here.

Pipeline Diagram

Feature branch -> Non-Prod sequence

AWS Core - GitHub Actions Pipeline

Main branch -> Prod sequence

AWS Core - GitHub Actions Pipeline

Setting up GitHub Actions

Environment Secrets

Environment secrets will need creating for storing some sensitive variables to be used by the pipeline. Instructions for creating a environment secrets can be found here.

Add the following secrets:

Variable NameDescriptionRequired for
AWS_ACCESS_KEY_IDAWS IAM User Access Key IDAWS Authentication
AWS_ACCOUNT_IDAWS Account IDAWS Authentication
AWS_SECRET_ACCESS_KEYAWS IAM User Secret Access KeyAWS Authentication
AWS_TF_STATE_BUCKETS3 Bucket name for Terraform stateTerraform State Management
AWS_TF_STATE_DYNAMOTABLEDynamoDB Table name for Terraform stateTerraform State Management
AWS_TF_STATE_ENCRYPTIONEncrypt Terraform state. true or falseTerraform State Management
AWS_TF_STATE_KEYUnique name for this applications Terraform stateTerraform State Management
AWS_TF_STATE_REGIONAWS regionTerraform State Management

Update pipeline template placeholders

Where possible, the Stacks CLI will have populated the correct values in the pipeline environment file .github/workflows/infrastructure.env. We very much recommend that you go through the whole .github/workflows directory to make sure that values are correct for your project. Once you are happy with the template, commit the changes to your repository.

Create the pipeline

Stacks generates the GitHub Actions workflow file in the directory expected by GitHub Actions, .github/workflows. Committing this file to the main branch of a GitHub repository will "create" the pipeline. Instructions for viewing the results can be found here