Skip to content

Commit 0c582c6

Browse files
Merge pull request #18 from sumanmanna134/phase2_aws
add actions
2 parents 3207194 + e16cba9 commit 0c582c6

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed

.github/workflows/terraform.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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

azure/azvar.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ variable "tenant_id" {
5353

5454
}
5555

56-
variable "GITHUB_TOKEN" {
57-
58-
}
5956

6057

6158

azure/provider.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,3 @@ provider "azurerm" {
2929
client_secret = var.client_secret
3030
features {}
3131
}
32-
33-
provider "github" {
34-
token = var.GITHUB_TOKEN
35-
36-
}

0 commit comments

Comments
 (0)