-
Notifications
You must be signed in to change notification settings - Fork 29
77 lines (69 loc) · 2.4 KB
/
docs-action.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
76
77
name: Build and deploy docs
on:
push:
branches:
- main
paths:
- "docs/**.md"
- "docs/mkdocs.yml"
workflow_dispatch:
jobs:
test-examples:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: |
mkdir /tmp/protoc && \
cd /tmp/protoc && \
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-x86_64.zip && \
unzip protoc.zip && \
mv /tmp/protoc/bin/protoc /usr/local/bin && \
chmod a+x /usr/local/bin/protoc && \
rm -rf /tmp/protoc
- run: cargo build --manifest-path ./examples/rust/Cargo.toml
build-and-deploy:
needs: test-examples
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Github repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
mkdir /tmp/protoc && \
cd /tmp/protoc && \
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-x86_64.zip && \
unzip protoc.zip && \
mv /tmp/protoc/bin/protoc /usr/local/bin && \
chmod a+x /usr/local/bin/protoc && \
rm -rf /tmp/protoc \
- name: Install poetry dependencies
run: poetry install --with docs
- name: Build docs
env:
DOCSBRANCH: "gh-pages"
DOCSREMOTE: "origin"
GITHUB_TOKEN: "${{ secrets.GH_PAGES_PAT }}"
run: mkdir -p ${GITHUB_WORKSPACE}/site/
- run: cd docs && poetry run mkdocs build --verbose --strict --clean --site-dir=${GITHUB_WORKSPACE}/site/
- run: poetry run pdoc -o ${GITHUB_WORKSPACE}/site/py glclient
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site