add actions #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
Check failure on line 49 in .github/workflows/terraform.yaml GitHub Actions / Terraform AutomationInvalid workflow file
|
||
run: terraform apply -auto-approve -input=false |