-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.4 KB
/
docs.yml
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
40
41
42
43
44
45
46
47
name: TF Docs
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
generate-docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/shakir85/tf-tools:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Run Git Setup
uses: ./.github/actions/setup-git
with:
repo-path: /__w/Terraform-Modules/Terraform-Modules
- name: Fetch latest changes
run: |
git fetch origin ${{ github.head_ref }}
git pull origin ${{ github.head_ref }}
- name: Generate VM Module Docs
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/vm
- name: Generate LX Module Docs
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/lxc
- name: Generate Cloud-Image Module Docs
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/get-cloud-image
- name: Commit changes
run: |
git add -A
git commit -m "chore: update Terraform docs [skip ci]" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}