docs: Align README with RIOT's, tone down on providing 'batteries inc… #3
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: Deploy docs | |
# GitHub Action workflow documentation: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
# This workflow is based on | |
# https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml | |
on: | |
push: | |
branches: main | |
paths: | |
- book/** | |
- src/** | |
- Cargo.toml | |
- rust-toolchain.toml | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
if: github.repository == 'ariel-os/ariel-os' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- id: get_toolchain | |
run: echo "toolchain=$(scripts/rust-toolchain.sh)" >> $GITHUB_OUTPUT | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ steps.get_toolchain.outputs.toolchain }} | |
# Docs of HAL crates must be generated after that of the main crate, | |
# otherwise this would result in broken links, as they use `--no-deps` for | |
# faster generation. | |
- name: Build rustdoc docs | |
run: | | |
cargo doc \ | |
-p ariel-os \ | |
--features " | |
bench, | |
coap, | |
csprng, | |
executor-thread, | |
external-interrupts, | |
hwrng, | |
i2c, | |
net, | |
no-boards, | |
random, | |
ariel-os-coap/doc, | |
spi, | |
storage, | |
threading, | |
usb, | |
usb-hid, | |
" | |
RUSTDOCFLAGS='-D warnings --cfg context="esp32c6"' cargo doc \ | |
--target=riscv32imac-unknown-none-elf \ | |
--no-deps \ | |
--features " | |
esp-hal-embassy/esp32c6, | |
esp-hal/esp32c6, | |
external-interrupts, | |
i2c, | |
spi, | |
" \ | |
-p ariel-os-esp | |
RUSTDOCFLAGS='-D warnings --cfg context="rp2040"' cargo doc \ | |
--no-deps \ | |
--features " | |
embassy-rp/rp2040, | |
external-interrupts, | |
i2c, | |
spi, | |
" \ | |
-p ariel-os-rp | |
RUSTDOCFLAGS='-D warnings --cfg context="nrf52840"' cargo doc \ | |
--no-deps \ | |
--features " | |
embassy-nrf/nrf52840, | |
external-interrupts, | |
i2c, | |
spi, | |
" \ | |
-p ariel-os-nrf | |
RUSTDOCFLAGS='-D warnings --cfg context="stm32wb55rgvx"' cargo doc \ | |
--no-deps \ | |
--features " | |
embassy-stm32/stm32wb55rg, | |
external-interrupts, | |
i2c, | |
spi, | |
" \ | |
-p ariel-os-stm32 | |
echo "<meta http-equiv=\"refresh\" content=\"0; url=ariel_os\">" > target/doc/index.html | |
mkdir -p ./_site/dev/docs/api | |
mv target/riscv32imac-unknown-none-elf/doc/ariel_os_esp/ ./_site/dev/docs/api | |
mv target/doc/* ./_site/dev/docs/api | |
- name: Install mdbook | |
run: | | |
mkdir mdbook | |
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Build the book | |
run: | | |
cd book | |
mdbook build | |
mv book ../_site/dev/docs | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./_site | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |