Skip to content

Update terraform.yaml #7

Update terraform.yaml

Update terraform.yaml #7

Workflow file for this run

name: 'Terraform Automation'
on:
push:
branches:
- main
pull_request:
jobs:
terraform:
name: 'Build Azure Infra'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Terraform Setup
uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Format
id: fmt
run: cd azure && terraform fmt
- name: Terraform init
id: init
run: cd azure && terraform init
- name: Terraform validate
id: validate
run: cd azure && terraform validate
- name: plan
run: cd azure && terraform plan
continue-on-error: true
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
if: steps.plan.outcome == 'success'
run: cd azure && terraform apply -auto-approve -input=false