blob: eb1581f5aab4009542af00718f2df349b0f50918 [file] [log] [blame]
# Licensed under the Apache-2.0 license
name: GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
env:
CARGO_TERM_COLOR: always
jobs:
build-and-deploy:
name: Build and Deploy to GitHub Pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: true
repository-cache: true
- name: Build mdbook documentation
id: build-docs
run: |
bazel build //docs
echo "path=$(bazel cquery --output=files //docs 2>/dev/null)" >> "$GITHUB_OUTPUT"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ${{ steps.build-docs.outputs.path }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4