Skip to content

Commit 9bce26b

Browse files
Merge pull request #17 from platzi/amines/16
Create main.yml
2 parents 4012198 + 3e99c42 commit 9bce26b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy infrastructure
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
terraform:
9+
env:
10+
ARM_CLIENT_ID: ${{secrets.CLIENT_ID}}
11+
ARM_CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
12+
ARM_SUBSCRIPTION_ID: ${{secrets.SUBSCRIPTION_ID}}
13+
ARM_TENANT_ID: ${{secrets.TENANT_ID}}
14+
name: 'Terraform'
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ${{ github.workspace }}/infra
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: hashicorp/setup-terraform@v1
22+
23+
- name: Terraform init
24+
id: init
25+
run: terraform init -backend-config="${{secrets.SAS_TOKEN}}
26+
27+
- name: Terraform validate
28+
id: validate
29+
run: terraform validate -no-color
30+
31+
- name: Terraform plan
32+
id: plan
33+
run: terraform plan -out plan.out
34+
35+
- name: Terraform apply
36+
id: apply
37+
run: terraform apply "plan.out"

0 commit comments

Comments
 (0)