Skip to content

Commit b6b1c4f

Browse files
author
Tristan Floch
committed
Split CI script in two dependent workflows
1 parent a2d58f7 commit b6b1c4f

3 files changed

Lines changed: 66 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy website
2+
on:
3+
workflow_run:
4+
workflows: ["Generate API reference"]
5+
branches: [main]
6+
types: [completed]
7+
jobs:
8+
deploy:
9+
needs: install-run-protoc-gen-doc
10+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Import generated API reference
15+
uses: actions/download-artifact@v3
16+
with:
17+
name: api-reference-protofiles
18+
path: docs/api-reference/
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.x
22+
- name: Install MkDocs and dependencies
23+
run: pip install mkdocs-material mkdocs-awesome-pages-plugin mdx_truly_sane_lists
24+
- name: Push website to gh-pages branch
25+
run: mkdocs gh-deploy --force
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Generate API reference
2+
on: push
3+
permissions:
4+
contents: write
5+
jobs:
6+
install-run-protoc-gen-doc:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Install protobuf-compiler
11+
run: sudo apt install -y protobuf-compiler
12+
- uses: actions/setup-go@v4
13+
with:
14+
go-version: '>=1.17.0'
15+
- name: Install protoc-gen-doc
16+
# TODO use this command instead when the PR is merged
17+
# https://github.com/pseudomuto/protoc-gen-doc/pull/522
18+
# run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
19+
run: |
20+
wget https://github.com/aristanetworks/protoc-gen-doc/archive/refs/heads/feat/separate-files.zip
21+
unzip separate-files.zip
22+
make \
23+
--directory=protoc-gen-doc-feat-separate-files \
24+
--print-directory \
25+
build
26+
- name: Generate markdown files from comments
27+
# TODO remove the --plugin argument when the PR is merged
28+
run: |
29+
protoc \
30+
--plugin=protoc-gen-doc=protoc-gen-doc-feat-separate-files/bin/protoc-gen-doc \
31+
-Iproto \
32+
--doc_out=docs/api-reference \
33+
--doc_opt=.github/templates/api-reference-md.tmpl,md,default,separate_files \
34+
proto/*.proto
35+
- name: Upload generated documentation as an artifact
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: api-reference-protofiles
39+
path: |
40+
docs/api-reference
41+
!docs/api-reference/index.md

0 commit comments

Comments
 (0)