Skip to content

Commit

Permalink
terraform workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinxValkyria committed Mar 2, 2024
1 parent f76ca6a commit 29f2728
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Checkout Repository
on:
push:
pull_request:
jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
12 changes: 12 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Setup Terraform
on:
push:
pull_request:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.3.0
12 changes: 12 additions & 0 deletions .github/workflows/terraform-apply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Terraform Apply
on:
push:
branches:
- main
jobs:
terraform_apply:
runs-on: ubuntu-latest
needs: terraform_plan
steps:
- name: Terraform apply
run: terraform apply --auto-approve
12 changes: 12 additions & 0 deletions .github/workflows/terraform-destroy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Terraform Destroy
on:
push:
branches:
- main
jobs:
terraform_destroy:
runs-on: ubuntu-latest
needs: terraform_apply
steps:
- name: Terraform destroy
run: terraform destroy --auto-approve
11 changes: 11 additions & 0 deletions .github/workflows/terraform-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Terraform Format
on:
push:
pull_request:
jobs:
terraform_format:
runs-on: ubuntu-latest
needs: terraform_init
steps:
- name: Terraform format
run: terraform fmt -check
11 changes: 11 additions & 0 deletions .github/workflows/terraform-init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Terraform Init
on:
push:
pull_request:
jobs:
terraform_init:
runs-on: ubuntu-latest
needs: [checkout, setup]
steps:
- name: Terraform init
run: terraform init -backend-config="bucket=${BUCKET_TF_STATE}"
11 changes: 11 additions & 0 deletions .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Terraform Plan
on:
push:
pull_request:
jobs:
terraform_plan:
runs-on: ubuntu-latest
needs: terraform_validate
steps:
- name: Terraform plan
run: terraform plan -no-color -input=false
11 changes: 11 additions & 0 deletions .github/workflows/terraform-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Terraform Validate
on:
push:
pull_request:
jobs:
terraform_validate:
runs-on: ubuntu-latest
needs: terraform_format
steps:
- name: Terraform validate
run: terraform validate

0 comments on commit 29f2728

Please sign in to comment.