forked from globalbao/azure-policy-as-code
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.47 KB
/
Terraform-CD-Tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Terraform-CD-Tests
on:
push:
branches: [main]
paths:
- "**.tf"
schedule:
- cron: "0 0 * * *" #at the end of every day
workflow_dispatch:
jobs:
Terraform-ValidationTests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Validate Terraform
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
VALIDATE_TERRAFORM: true
VALIDATE_TERRAFORM_TERRASCAN: true
Terraform-CD-Tests:
env:
TF_IN_AUTOMATION: true
TF_INPUT: false
ARM_CLIENT_ID: ${{ secrets.AZURE_BATCAVE_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZURE_BATCAVE_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_BATCAVE_SUBSCRIPTION }}
ARM_TENANT_ID: ${{ secrets.AZURE_BATCAVE_TENANT }}
needs: Terraform-ValidationTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hashicorp/[email protected]
with:
cli_config_credentials_token: ${{ secrets.TF_TOKEN }}
terraform_version: 1.0.3
- name: Terraform Init
id: init
run: terraform init -backend-config=backend.hcl -no-color
working-directory: Terraform
- name: Terraform Apply
id: apply
run: terraform apply -auto-approve -no-color
working-directory: Terraform