Skip to content

Commit 5e1fa68

Browse files
committed
[skip changelog] Split publish docs workflow
1 parent 9f49ea3 commit 5e1fa68

File tree

2 files changed

+70
-8
lines changed

2 files changed

+70
-8
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: publish-docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
# At this day, GitHub doesn't support YAML anchors, d'oh!
8+
paths:
9+
- "docs/**"
10+
- "docsgen/**"
11+
- "cli/**"
12+
- "rpc/**"
13+
- ".github/workflows/publish-docs.yaml"
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Install Taskfile
24+
uses: Arduino/actions/setup-taskfile@master
25+
with:
26+
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Setup Go
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: "1.14"
32+
33+
- name: Install Go dependencies
34+
run: |
35+
go version
36+
go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
37+
38+
- name: Install protoc compiler
39+
uses: arduino/setup-protoc@v1
40+
with:
41+
repo-token: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Setup Python
44+
uses: actions/setup-python@v1
45+
with:
46+
python-version: "3.8"
47+
architecture: "x64"
48+
49+
- name: Cache dependencies
50+
uses: actions/cache@v1
51+
with:
52+
path: ~/.cache/pip
53+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
54+
restore-keys: |
55+
${{ runner.os }}-pip-
56+
57+
- name: Install Python dependencies
58+
run: |
59+
python3 -m pip install --upgrade pip
60+
python3 -m pip install -r ./requirements_docs.txt
61+
62+
- name: Publish docs
63+
# Determine docs version for the commit pushed and publish accordingly using Mike.
64+
# Publishing implies creating a git commit on the gh-pages branch, we let
65+
# ArduinoBot own these commits.
66+
run: |
67+
git config --global user.email "[email protected]"
68+
git config --global user.name "ArduinoBot"
69+
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
70+
python docs/build.py

.github/workflows/publish-docs.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@ name: publish-docs
33
on:
44
push:
55
branches:
6-
- master
76
# release branches have names like 0.8.x, 0.9.x, ...
87
- "[0-9]+.[0-9]+.x"
9-
# At this day, GitHub doesn't support YAML anchors, d'oh!
10-
paths:
11-
- "docs/**"
12-
- "docsgen/**"
13-
- "cli/**"
14-
- "rpc/**"
15-
- ".github/workflows/publish-docs.yaml"
168

179
jobs:
1810
publish:

0 commit comments

Comments
 (0)