-
-
Notifications
You must be signed in to change notification settings - Fork 9
75 lines (62 loc) · 1.66 KB
/
build-pb-doc.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
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
name: build-pb-doc
on:
push:
branches: [main]
paths:
- "pb/tzinfo.proto"
- ".github/workflows/build-pb-doc.yml"
pull_request:
branches: [main]
paths:
- "pb/tzinfo.proto"
- ".github/workflows/build-pb-doc.yml"
permissions:
contents: write
deployments: write
jobs:
build-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Install go pkgs
run: |
make install
- name: Install pb pkgs
run: |
go install github.com/golang/protobuf/protoc-gen-go@latest
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
- name: Setup protoc
uses: arduino/setup-protoc@v2.1.0
- name: Build doc
run: |
make pb
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
if: ${{ github.ref_name == 'main' }}
with:
name: "Probuf HTML File"
path: "pb/pb.html"
push-doc:
needs: build-doc
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Download a Build Artifact
uses: actions/download-artifact@v4.0.0
with:
name: "Probuf HTML File"
path: "./docs"
- name: Push file update
run: |
git add ./docs/pb.html
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "Update Probuf HTML doc"
git push