Use built in action #7
Workflow file for this run
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: 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: Run structurizr-cli action | |
uses: aidmax/structurizr-cli-action@v1 | |
with: | |
id: ${{ secrets.STRUCTURIZR_WORKSPACE_ID }} | |
key: ${{ secrets.STRUCTURIZR_API_KEY }} | |
secret: ${{ secrets.STRUCTURIZR_API_SECRET }} | |
workspace: './' | |
- name: Commit and Push Diagram | |
run: | | |
git config --global user.name "Documentation Bot" | |
git config --global user.email "[email protected]" | |
git commit -am "Update documentation" | |
git push |