Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DJBerwick committed Dec 7, 2023
1 parent 1567198 commit 0abc268
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Terraform'

on: push

env:
TF_LOG: INFO
TF_INPUT: false

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

# Use the Bash shell regardless whether the GitHub Actions runner is
# ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash

steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

# Install the preferred version of Terraform CLI
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2

# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
id: init
run: terraform init

# Run a terraform fmt for push
- name: Terraform Format
id: fmt
run: terraform fmt -check

# Run a terraform validate
# Run even if formatting fails
- name: Terraform Validate
id: validate
if: (success() || failure())
run: terraform validate
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
*.tfplan

# .pem files
*.pem
*.pem

backend_local.tf
11 changes: 0 additions & 11 deletions backend.tf

This file was deleted.

0 comments on commit 0abc268

Please sign in to comment.