File tree 3 files changed +50
-8
lines changed 3 files changed +50
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Terraform Automation'
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+
9
+ jobs :
10
+ terraform :
11
+ name : ' Build Azure Infra'
12
+ runs-on : ubuntu-latest
13
+ permissions :
14
+ pull-requests : write
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v3
18
+
19
+ - name : Terraform Setup
20
+ uses : hashicorp/setup-terraform@v2
21
+ with :
22
+ cli_config_credentials_token : ${{ secrets.TF_API_TOKEN }}
23
+
24
+ - name : Select Azure
25
+ id : SA
26
+ run : cd azure
27
+
28
+ - name : Terraform Format
29
+ id : fmt
30
+ run : terraform fmt
31
+
32
+ - name : Terraform init
33
+ id : init
34
+ run : terraform init
35
+
36
+ - name : Terraform validate
37
+ id : validate
38
+ run : terraform validate
39
+
40
+ - name : plan
41
+ run : terraform plan -input=false
42
+ continue-on-error : true
43
+
44
+ - name : Terraform Plan Status
45
+ if : steps.plan.outcome == 'failure'
46
+ run : exit 1
47
+
48
+ - name : Terraform Apply
49
+ if : step.plan.outcome == 'success'
50
+ run : terraform apply -auto-approve -input=false
Original file line number Diff line number Diff line change @@ -53,9 +53,6 @@ variable "tenant_id" {
53
53
54
54
}
55
55
56
- variable "GITHUB_TOKEN" {
57
-
58
- }
59
56
60
57
61
58
Original file line number Diff line number Diff line change @@ -29,8 +29,3 @@ provider "azurerm" {
29
29
client_secret = var. client_secret
30
30
features {}
31
31
}
32
-
33
- provider "github" {
34
- token = var. GITHUB_TOKEN
35
-
36
- }
You can’t perform that action at this time.
0 commit comments