blob: fd0180fc3a19368533821536a5ecbe83a5ceac4b [file]
# 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.19.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 --platform_suffix= --@@pigweed+//pw_kernel:enable_tests=false //docs 2>/dev/null)" >> "$GITHUB_OUTPUT"
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ${{ steps.build-docs.outputs.path }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5