add devcontainer, actions, and main.tf #1
This file contains 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 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 }} |