Skip to content

Commit

Permalink
Added workflow to deploy with Terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
ivancea authored Jul 21, 2024
1 parent 2fec331 commit 616febc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Terraform'

on:
push:
branches: [ "cloud" ]

permissions:
contents: read

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
environment: production

defaults:
run:
shell: bash
working-directory: ./terraform

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Terraform Init
run: terraform init

- name: Terraform Format
run: terraform fmt -check

- name: Terraform Plan
run: terraform plan -input=false

- name: Terraform Apply
if: github.ref == 'refs/heads/"cloud"' && github.event_name == 'push'
run: terraform apply -auto-approve -input=false

0 comments on commit 616febc

Please sign in to comment.