Skip to content

Update terraform.yaml #9

Update terraform.yaml

Update terraform.yaml #9

Workflow file for this run

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