Spike/gh actions tf checks #16
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: Check Terraform project | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
jobs: | |
terraform-checks: | |
name: Run terraform project checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hashicorp/setup-terraform@v2 | |
- name: Check project tf base digitalocean-k8s | |
run: | | |
cd \{\{cookiecutter.project_dirname\}\}/terraform/base/digitalocean-k8s | |
terraform init -backend=false -lock=false -reconfigure | |
terraform fmt -check | |
terraform validate | |
- name: Check project tf cluster digitalocean-k8s | |
run: | | |
cd \{\{cookiecutter.project_dirname\}\}/terraform/cluster/digitalocean-k8s | |
terraform init -backend=false -lock=false -reconfigure | |
terraform fmt -check | |
terraform validate | |
- name: Check project tf cluster other-k8s | |
run: | | |
cd \{\{cookiecutter.project_dirname\}\}/terraform/cluster/digitalocean-k8s | |
terraform init -backend=false -lock=false -reconfigure | |
terraform fmt -check | |
terraform validate | |
- name: Check project tf environment digitalocean-k8s | |
run: | | |
cd \{\{cookiecutter.project_dirname\}\}/terraform/environment/digitalocean-k8s | |
terraform init -backend=false -lock=false -reconfigure | |
terraform fmt -check | |
terraform validate | |
- name: Check project environment other-k8s | |
run: | | |
cd \{\{cookiecutter.project_dirname\}\}/terraform/environment/other-k8s | |
terraform init -backend=false -lock=false -reconfigure | |
terraform fmt -check | |
terraform validate |