Update terraform-apply.yaml #6
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 (OIDC) | |
on: | |
push: | |
branches: | |
- main # or any other branch you want to trigger the deployment | |
paths: | |
- '**/*.tf' | |
- '**/*.yaml' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
terraform-apply: | |
name: Terraform Apply | |
runs-on: ubuntu-latest | |
env: | |
TF_VAR_pgpassword: ${{ secrets.TF_VAR_PGPASSWORD }} | |
TF_VAR_pghost: ${{ secrets.TF_VAR_PGHOST }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: arn:aws:iam::035866691871:role/gha-incubator | |
role-session-name: ghaincubatorsession | |
aws-region: us-west-2 | |
- name: Terraform Apply | |
uses: dflook/terraform-apply@v1 | |
with: | |
path: terraform | |
auto_approve: true | |
backend_config_file: terraform/prod.backend.tfvars |