mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
name: Build documentation
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
deploy:
|
|
required: true
|
|
type: boolean
|
|
|
|
|
|
jobs:
|
|
build-docs:
|
|
name: Build
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: extractions/setup-just@v1
|
|
- name: Install toolchain
|
|
shell: bash
|
|
run: just default-toolchain
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Setup mdBook
|
|
uses: peaceiris/actions-mdbook@v1
|
|
- name: Install Dependencies
|
|
shell: bash
|
|
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
|
|
- name: Build
|
|
working-directory: docs
|
|
shell: bash
|
|
run: mdbook build
|
|
- name: API Documentation
|
|
shell: bash
|
|
run: cargo doc -p maplibre --no-deps --lib --document-private-items
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: api-docs
|
|
path: target/doc/
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: book
|
|
path: docs/book/
|
|
deploy-docs:
|
|
needs: build-docs
|
|
if: inputs.deploy
|
|
name: Deploy
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Download api-docs
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: api-docs
|
|
path: artifacts/api
|
|
- name: Download book
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: book
|
|
path: artifacts/book
|
|
- name: Deploy
|
|
uses: JamesIves/github-pages-deploy-action@v4.3.3
|
|
with:
|
|
branch: gh-pages
|
|
folder: artifacts
|
|
target-folder: docs
|