MAINT/DOC setup documentation workflow #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docs | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev | |
- name: Rust setup | |
uses: dtolnay/rust-toolchain@stable | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: ./src-tauri -> target | |
- name: Build Rust docs | |
run: | | |
cd src-tauri | |
cargo doc --no-deps | |
- name: Node setup and cache | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: npm | |
- name: Install doc dependencies | |
run: | | |
npm install | |
cd website | |
npm install | |
- name: Build docs | |
run: | | |
cd website | |
npm run build | |
- name: Copy Rust docs to build directory | |
run: cp -r src-tauri/target/doc website/build/rustdoc | |
- name: Upload build artifact | |
id: artifact-upload | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: website/build | |
- name: Output artifact URL | |
run: echo 'Artifact URL is ${{ steps.artifact-upload.outputs.artifact-url }}' |