-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.17 KB
/
documentation.yml
File metadata and controls
79 lines (63 loc) · 2.17 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: Build Documentation
on:
push:
branches:
- '**'
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout main repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.1.0'
- name: Cache protoc
id: cache-protoc
uses: actions/cache@v4
with:
path: ~/.local/bin/protoc
key: ${{ runner.os }}-protoc-21.12
- name: Install Protocol Buffers Compiler
if: steps.cache-protoc.outputs.cache-hit != 'true'
run: |
PROTOC_VERSION=21.12
PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-x86_64.zip
curl -Lo $PROTOC_ZIP https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}
mkdir -p ~/.local
unzip -o $PROTOC_ZIP -d ~/.local
rm -f $PROTOC_ZIP
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Verify protoc installation
run: |
export PATH="$HOME/.local/bin:$PATH"
protoc --version
- name: Checkout Wiki repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: .wiki
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies (without prepare script)
run: npm install --ignore-scripts
- name: Generate proto files
run: npm run proto:generate
- name: Create index.ts for generated files
run: |
echo "export * from './Main';" > src/generated/index.ts
- name: Build TypeScript
run: npm run build
- name: Configure Git for documentation
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Generate documentation
run: npm run docs:generate
- name: Commit and push wiki changes
run: |
cd .wiki
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "Automatical update Wiki" && git push)