-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.56 KB
/
main.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
name: Terraform with OIDC
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
Ubuntu-latest:
runs-on: ubuntu-latest
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform Format
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: |
terraform init \
-backend-config="storage_account_name=${{ secrets.AZURE_STATE_STORAGE_ACCOUNT_NAME }}" \
-backend-config="container_name=${{ secrets.AZURE_STATE_CONTAINER_NAME }}" \
-backend-config="resource_group_name=${{ secrets.AZURE_RESOURCE_GROUP_NAME }}" \
-backend-config="key=terraform.avd.tfstate" \
-backend-config="use_oidc=true"
working-directory: ./terraform/avd
- name: Terraform Validate
id: validate
run: terraform validate
working-directory: ./terraform/avd
- name: Terraform Plan
id: plan
run: terraform plan -no-color -input=false
working-directory: ./terraform/avd
- name: Terraform Apply
id: apply
run: terraform apply -auto-approve -input=false
working-directory: ./terraform/avd