Add a GitHub workflow
The terraform-on-changed-dirs
workflow is a GitHub Action that triggers when changes are made within configured stacks. This workflow is used to deploy the infrastructure changes to the environment in AWS.
Step 1: Create a new configuration file
In the repo-iac/.github/workflows/_config/dev/
folder, create a new configuration file for the terraform-on-changed-dirs
workflow:
Step 1: Update the configuration file
Update the configuration file for the Terraform-on-changed-dirs workflow:
repo-iac/.github/workflows/_config/dev/terraform-on-changed-dirs.yml
FileTypes:
- "**.tf"
- "**.json"
StacksRootDir: "environments/dev"
Stacks:
- name: "app-too-tikki"
githubEnvironment: "pirates-dev-app-too-tikki-cicd"
FileTypes
defines which files you want the workflow to trigger onStacksRootDir
is the root directory for your stacks in the environmentStacks
is a list of stacks that you want to trigger on. Each stack has aname
(matching the stack directory name) and agithubEnvironment
that corresponds to the outcome when you added a GitHub environment .
Step 2: Install the terraform-on-changed-dirs
package
Step 3: Verify
Verify that the workflow file repo-iac/.github/workflows/_gp_pirates-dev_terraform_on_changed_dirs.yml
has been created.
Commit your files
At this stage it is a good idea to commit your files.