Skip to content

Commit

Permalink
feature #1 - Add terraform CD
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeniosales committed Oct 15, 2022
1 parent 5697ad4 commit bcaa4a6
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Terraform CD'

on:
push:
branches: [ "main" ]
pull_request:

permissions:
contents: read

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

defaults:
run:
shell: bash

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

- 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/"main"' && github.event_name == 'push'
run: terraform apply -auto-approve -input=false

0 comments on commit bcaa4a6

Please sign in to comment.