-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (27 loc) · 869 Bytes
/
deploy.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
name: Deploy Terraform Changes
on:
push:
branches:
- main # Trigger this action only on pushes to the main branch
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.0 # Specify your Terraform version
- name: Terraform Init
run: terraform init
- name: Terraform Plan
id: plan
run: terraform plan -out=tfplan
- name: Apply Terraform Changes
if: github.ref == 'refs/heads/main'
run: terraform apply -auto-approve tfplan
env:
TF_VAR_dbt_account_id: ${{ secrets.TF_VAR_dbt_account_id }}
TF_VAR_dbt_token: ${{ secrets.TF_VAR_dbt_token }}
TF_VAR_dbt_host_url: ${{ secrets.TF_VAR_dbt_host_url }}