Skip to content

Merge pull request #10 from Indu-Sah-Foundation/test #7

Merge pull request #10 from Indu-Sah-Foundation/test

Merge pull request #10 from Indu-Sah-Foundation/test #7

Workflow file for this run

name: Terraform Apply
on:
push:
branches: [main]
paths:
- "**/*.tf"
- "**/*.tfvars"
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.8
- name: Azure Login via OIDC
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Terraform Init
run: terraform init
- name: Terraform Validate
run: terraform validate
- name: Terraform Plan
run: terraform plan -var-file="env.tfvars" -out=tfplan
- name: Terraform Apply
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: terraform apply -auto-approve tfplan