Add a GitHub workflow
Deprecated
A new and improved CI/CD rig is coming soon. Planning to set up a new CI/CD pipeline? Reach out to us in team Utviklerflyt and we'll get you started with the latest setup. We expect to publish updated documentation in March.
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 2: Update the configuration file
Update the configuration file for the Terraform-on-changed-dirs workflow:
FileTypes:
- "**.tf"
- "**.json"
StacksRootDir: "environments/dev"
Stacks:
- name: "app-too-tikki"
githubEnvironment: "pirates-dev-app-too-tikki-cicd"
FileTypesdefines which files you want the workflow to trigger onStacksRootDiris the root directory for your stacks in the environmentStacksis a list of stacks that you want to trigger on. Each stack has aname(matching the stack directory name) and agithubEnvironmentthat corresponds to the outcome when you added a GitHub environment .
Step 3: Install the terraform-on-changed-dirs package
Step 4: 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.