Merge pull request #20 from platzi/amines/19 #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy infrastructure | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
terraform: | |
env: | |
ARM_CLIENT_ID: ${{secrets.CLIENT_ID}} | |
ARM_CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} | |
ARM_SUBSCRIPTION_ID: ${{secrets.SUBSCRIPTION_ID}} | |
ARM_TENANT_ID: ${{secrets.TENANT_ID}} | |
name: 'Terraform' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ${{ github.workspace }}/infra | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: hashicorp/setup-terraform@v1 | |
- name: Terraform init | |
id: init | |
run: terraform init -backend-config="${{secrets.SAS_TOKEN}}" | |
- name: Terraform validate | |
id: validate | |
run: terraform validate -no-color | |
- name: Terraform plan | |
id: plan | |
run: terraform plan -out plan.out | |
- name: Terraform apply | |
id: apply | |
run: terraform apply "plan.out" |