Skip to content

Patch-based workflow for tutorials in Pavex's documentation #12

Patch-based workflow for tutorials in Pavex's documentation

Patch-based workflow for tutorials in Pavex's documentation #12

Workflow file for this run

name: Build and store docs artifact
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_pavex_cli:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/[email protected]
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./libs -> ./libs/target"
- name: Build CLI
run: |
cd libs
cargo build --package pavex_cli --bin pavex --release
- name: Store CLI artifact
uses: actions/upload-artifact@v2
with:
name: pavex_cli
path: libs/target/release/pavex
build_docs:
runs-on: ubuntu-latest
needs: build_pavex_cli
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/[email protected]
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./libs -> ./libs/target"
- name: Build API reference
run: |
cd libs
cargo doc --package pavex --no-deps
- name: Copy API reference files
run: |
mkdir -p docs/api_reference
cp -r libs/target/doc/* docs/api_reference
- name: Link Checker
uses: lycheeverse/lychee-action@v1
with:
fail: true
args: --base . --exclude-loopback --exclude-path="docs/api_reference" --require-https --verbose --no-progress docs
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: docs/
load: true
tags: pavex-docs
- name: Build docs
run: |
docker run --rm -v ${PWD}:/docs pavex-docs build
- uses: actions/upload-artifact@v3
with:
name: docs
path: site/