Skip to content

Terraform apply for github-actions terraform #2

Terraform apply for github-actions terraform

Terraform apply for github-actions terraform #2

name: Terraform apply for github-actions terraform
on:
push:
branches:
- main
workflow_dispatch: # Allow manual trigger
jobs:
terraform-apply:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./terraform/services/github-actions
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-tfenv-terraform
- uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ vars.RUNNER_ACCOUNT_ROLE }}
aws-region: us-east-1
- run: terraform init -reconfigure -backend-config=../../backends/bcda.s3.tfbackend
- run: terraform apply
env:
TF_VAR_ami_account: ${{ vars.RUNNER_AMI_ACCOUNT }}
TF_VAR_ami_filter: ${{ vars.RUNNER_AMI_FILTER }}
TF_VAR_app_id: ${{ vars.RUNNER_APP_ID }}
TF_VAR_key_base64: ${{ secrets.RUNNER_APP_KEY_BASE64 }}
TF_VAR_webhook_secret: ${{ secrets.RUNNER_WEBHOOK_SECRET }}