Skip to content

Build and deploy docs #72

Build and deploy docs

Build and deploy docs #72

Workflow file for this run

name: Build and deploy docs
on:
push:
branches:
- main
paths:
- "docs/**.md"
- "docs/mkdocs.yml"
workflow_dispatch:
jobs:
test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: arduino/setup-protoc@v3
with:
version: "3.19.3"
- run: cargo build --manifest-path ./examples/rust/getting-started/Cargo.toml
build:
needs: test
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@v3
- name: Set up Python Virtualenv
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup venv
run: |
python3 -m venv .venv
.venv/bin/python -m pip install poetry
- uses: dtolnay/rust-toolchain@nightly
- name: Set up dependencies
run: |
.venv/bin/pip install -U maturin pip
sudo apt-get update -qq
sudo apt-get install -y -qq make
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "27.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
cd libs/gl-client-py/
.venv/bin/poetry export --without-hashes --with=docs > /tmp/requirements.txt
.venv/bin/pip install -U -r /tmp/requirements.txt
- name: Build and install gl-client-py
run: |
(cd libs/gl-client-py; ../../.venv/bin/maturin develop)
- name: Build docs
env:
DOCSBRANCH: "gh-pages"
DOCSREMOTE: "origin"
GITHUB_TOKEN: "${{ secrets.GH_PAGES_PAT }}"
run: |
PATH=$(pwd)/.venv/bin:$PATH make docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site