Skip to content

Update terraform.yaml #10

Update terraform.yaml

Update terraform.yaml #10

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
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: 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: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.plan.outcome == 'success'
run: cd azure && terraform apply -auto-approve -input=false