Skip to content

Deploy Docs Site

Deploy Docs Site #20

name: Deploy Docs Site
# Triggers on tags like v0.0.1
on:
push:
tags:
- 'v*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
node_modules
.yarn/cache
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'tool/protoc-gen-meshdoc/go.mod') }}
restore-keys: |
${{ runner.os }}-deps-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install buf CLI
run: |
# Install buf CLI for protobuf generation
curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m)" -o "/tmp/buf"
sudo mv "/tmp/buf" "/usr/local/bin/buf"
sudo chmod +x "/usr/local/bin/buf"
- name: Setup Python environment and run code generation
run: |
# Create and activate Python virtual environment
python -m venv .venv
source .venv/bin/activate
pip install grpcio-tools jinja2
# Run code generation with activated virtual environment
./scripts/code-generation/generate-all.sh
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Docusaurus
run: yarn build:docs
env:
NODE_ENV: production
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4