Skip to content

Commit

Permalink
Merge pull request #18 from sumanmanna134/phase2_aws
Browse files Browse the repository at this point in the history
add actions
  • Loading branch information
sumanmanna134 authored Sep 20, 2024
2 parents 3207194 + e16cba9 commit 0c582c6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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: cd azure

- 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 -input=false
continue-on-error: true

- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1

- name: Terraform Apply
if: step.plan.outcome == 'success'
run: terraform apply -auto-approve -input=false
3 changes: 0 additions & 3 deletions azure/azvar.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ variable "tenant_id" {

}

variable "GITHUB_TOKEN" {

}



5 changes: 0 additions & 5 deletions azure/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ provider "azurerm" {
client_secret = var.client_secret
features {}
}

provider "github" {
token = var.GITHUB_TOKEN

}

0 comments on commit 0c582c6

Please sign in to comment.