Skip to content

Merge pull request #30 from vMarkusK/devcontainer #25

Merge pull request #30 from vMarkusK/devcontainer

Merge pull request #30 from vMarkusK/devcontainer #25

name: Validate and Deploy on Merge
on:
push:
branches:
- main
- master
jobs:
deploy:
name: Validate and Deploy
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_AD_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZURE_AD_TENANT_ID }}
steps:
- uses: actions/checkout@v4
name: Checkout source code
- uses: terraform-linters/setup-tflint@v3
name: Setup TFLint
with:
tflint_version: latest
- name: Init TFLint
run: tflint --init
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
id: tflint
run: tflint -f compact
- name: Terraform Setup
uses: hashicorp/setup-terraform@v3
- name: Terraform Init
id: init
run: terraform init -backend-config="resource_group_name=tfstate" -backend-config="storage_account_name=tfstate1910602351" -backend-config="container_name=hubspoke" -backend-config="key=hubandspokemin.tfstate"
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Apply
id: plan
run: terraform apply -no-color -auto-approve