Skip to content

Add leader election for HA #5

Add leader election for HA

Add leader election for HA #5

Workflow file for this run

# Copyright (c) 2025 Erick Bourgeois, firestoned
# SPDX-License-Identifier: Apache-2.0
name: Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'src/**/*.rs'
- '.github/workflows/docs.yaml'
pull_request:
paths:
- 'docs/**'
- 'src/**/*.rs'
- '.github/workflows/docs.yaml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment; cancel any in-progress run on the same
# branch so a rapid series of pushes never leaves a stale deploy running.
concurrency:
group: "pages"
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Override the cross-compilation linkers set in .cargo/config.toml.
# On Linux CI runners the native target IS x86_64-unknown-linux-gnu so
# cargo picks up the macOS cross-compiler setting — which isn't installed.
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: cc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: cc
jobs:
build:
name: 📚 Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for git-revision-date-localized plugin
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Configure Poetry
run: |
cd docs
poetry config virtualenvs.in-project true
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: docs/.venv
key: ${{ runner.os }}-poetry-${{ hashFiles('docs/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install documentation dependencies
run: |
cd docs
poetry install --no-interaction --no-ansi
- name: Cache cargo build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-docs-
- name: Build documentation
run: make docs
- name: Check for broken links
if: github.event_name == 'pull_request'
continue-on-error: true
run: |
npm install -g linkinator
linkinator docs/site/ --recurse --skip "rustdoc/.*" --verbosity error
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v5
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/site
deploy:
name: 🚀 Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4