-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.37 KB
/
generate-documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Generate - Documentation
on:
push:
branches: [ "main", "docs/**" ]
jobs:
generate-diagram:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v3
- name: Install Terraform Docs
env:
TERRAFORM_DOCS_VERSION: 0.18.0
run: |
wget https://github.com/terraform-docs/terraform-docs/releases/download/v${{ env.TERRAFORM_DOCS_VERSION }}/terraform-docs-v${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz
tar -xvf terraform-docs-v${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz terraform-docs
sudo mv terraform-docs /usr/local/bin/
rm terraform-docs-v${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz
- name: Terraform fmt
id: fmt
working-directory: ./src/infrastructure/terraform
run: terraform fmt -recursive
- name: Generate TF Documentation
run: terraform-docs markdown table src/infrastructure/terraform --output-file ../../../docs/architecture/Terraform.md
- name: Commit and Push Documentation
run: |
git config --global user.name "Documentation Bot"
git config --global user.email "[email protected]"
git commit -am "Update documentation"
git push