README review updates #1
This file contains hidden or 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: Prod Build | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
prod_build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
TF_LOG: INFO | |
TF_INPUT: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# Checkout the GitHub Actions runner | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Get AWS Credentials via OIDC | |
- name: Configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.AWS_ROLE_ARN }} | |
aws-region: ${{ vars.AWS_REGION }} | |
audience: sts.amazonaws.com | |
# Install Terraform CLI | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.8 | |
# Run Terraform commands | |
- name: Terraform Init | |
id: init | |
env: | |
TF_VAR_AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }} | |
run: terraform -chdir="terraform" init -backend-config=backend-prod.conf | |
- name: Terraform Plan | |
id: plan | |
run: terraform -chdir="terraform" plan -var-file=vars-prod.tfvars | |
- name: Terraform Apply | |
id: apply | |
run: terraform -chdir="terraform" apply -auto-approve -var-file=vars-prod.tfvars |