Skip to content

Documentation Deploy #1053

Documentation Deploy

Documentation Deploy #1053

Workflow file for this run

name: Documentation Deploy
on:
push:
branches:
- main
paths:
- "src/**"
- "justfile"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
# Build the documentation and upload as an artifact
docs-build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust Nightly and Rust Docs
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2024-07-19
rustup component add rust-docs
- name: Rust Cache
uses: Swatinem/rust-cache@v2
id: cache-cargo
with:
prefix-key: ${{ runner.os }}-v3-cargo
shared-key: nightly-debug
key: ${{ hashFiles('Cargo.lock', 'Cargo.toml') }}
cache-provider: "github"
cache-directories: "~/.cargo/bin/"
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Install libsasl2-dev libssl-dev
run: sudo apt-get update && sudo apt install -y build-essential pkg-config libssl-dev libsasl2-dev
- name: Set up Just
uses: extractions/setup-just@v2
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Set up dependencies
if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
run: |
cargo install killport || true
cargo install wait-service || true
- name: Install Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Generate docs
run: |
just doc -2024-07-19
echo "<meta http-equiv='refresh' content='0; URL=./stratus/'>" >> target/doc/index.html
chmod -c -R +rX target/doc/
- name: Generate coverage
run: |
just stratus-test-coverage --html
mv target/llvm-cov/html target/doc/coverage
chmod -c -R +rX target/doc/
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: "target/llvm-cov/html"
# Upload the documentation to GitHub Pages
docs-release:
runs-on: ubuntu-latest
needs: docs-build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download GH Pages artifact
uses: actions/download-artifact@v4
- name: Configure GH Pages
uses: actions/configure-pages@v5
- name: Deploy to GH Pages
id: deployment
uses: actions/deploy-pages@v4