Terraform apply staging #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Terraform apply staging' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'terragrunt/**' | |
- '!terragrunt/env/staging/**' | |
- '.github/workflows/tf_apply_staging.yml' | |
env: | |
AWS_REGION: ca-central-1 | |
TERRAFORM_VERSION: 1.10.4 | |
TERRAGRUNT_VERSION: 0.72.3 | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
actions: write | |
checks: write | |
statuses: write | |
jobs: | |
terragrunt-apply: | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Terraform Tools | |
uses: cds-snc/terraform-tools-setup@v1 | |
- name: Configure aws credentials using OIDC | |
uses: aws-actions/configure-aws-credentials@v4.0.2 | |
with: | |
role-to-assume: arn:aws:iam::992382783569:role/react-answers-apply | |
role-session-name: TFApply | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Apply network | |
working-directory: terragrunt/env/staging/network | |
run: terragrunt apply --terragrunt-non-interactive -auto-approve | |
- name: Apply ecr | |
working-directory: terragrunt/env/staging/ecr | |
run: terragrunt apply --terragrunt-non-interactive -auto-approve | |
- name: Apply hosted zone | |
working-directory: terragrunt/env/staging/hosted_zone | |
run: terragrunt apply --terragrunt-non-interactive -auto-approve |