forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs-generation.yml
More file actions
79 lines (68 loc) 路 2.48 KB
/
Copy pathdocs-generation.yml
File metadata and controls
79 lines (68 loc) 路 2.48 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Docs Generation
on:
push:
branches: [main]
paths:
- 'infrastructure/terraform/**'
- 'infrastructure/k8s/**'
- 'infrastructure/scripts/generate-docs.sh'
- 'infrastructure/scripts/generate-diagrams.py'
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
generate-api-docs:
name: API Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate OpenAPI and static docs
run: |
version="${{ github.event.release.tag_name }}"
if [ -z "$version" ]; then version="$(date +%Y.%m.%d)"; fi
bash infrastructure/scripts/generate-api-docs.sh "$version"
- name: Commit API docs
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add infrastructure/docs/openapi.json infrastructure/docs/site infrastructure/docs/version.txt || true
if git diff --cached --quiet; then
echo "No API docs changes to commit."
exit 0
fi
git commit -m "docs(api): update generated API docs"
git push
generate-infra-docs:
name: Infrastructure Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install terraform-docs
run: |
curl -sSLo /tmp/terraform-docs.tar.gz \
https://github.com/terraform-docs/terraform-docs/releases/download/v0.17.0/terraform-docs-v0.17.0-linux-amd64.tar.gz
tar -xzf /tmp/terraform-docs.tar.gz -C /usr/local/bin terraform-docs
chmod +x /usr/local/bin/terraform-docs
- name: Generate infrastructure docs
run: bash infrastructure/scripts/generate-docs.sh
- name: Generate diagrams
run: python3 infrastructure/scripts/generate-diagrams.py
- name: Commit generated docs
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add infrastructure/docs/auto-generated/
if git diff --cached --quiet; then
echo "No infra docs changes to commit."
exit 0
fi
git commit -m "docs(infra): update auto-generated infrastructure docs [skip ci]"
git push