-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.01 KB
/
terraform.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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: Select Azure
id: SA
run: ls
- 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: steps.plan.outcome == 'success'
run: terraform apply -auto-approve -input=false