Skip to content

Commit

Permalink
Github actions for Terraform validate + auto documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RaJiska committed Nov 14, 2023
1 parent 88346ff commit ae22e7f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Generate Documentation
on:
push:
branches:
- main
permissions:
contents: write
jobs:
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Render terraform docs and push changes
uses: terraform-docs/gh-actions@main
with:
working-dir: .
config-file: ".terraform-docs.yml"
output-method: "replace"
git-push: "true"
template: -|
{{ .Content }}
23 changes: 23 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Terraform
on: [push, pull_request]
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.0

- name: Terraform Init
id: init
run: terraform init

- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true

- name: Terraform Validate
id: validate
run: terraform validate -no-color
13 changes: 13 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
formatter: "markdown"

header-from: docs/header.md

sections:
hide: ["modules"]

output:
mode: replace

sort:
enabled: true
by: name

0 comments on commit ae22e7f

Please sign in to comment.