Skip to content

Commit

Permalink
workflow: Add a docs workflow
Browse files Browse the repository at this point in the history
This workflow will build the docs for the zephyr crates for a single
particular build, and publish them to GH pages.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z committed Sep 12, 2024
1 parent 83d0bdc commit 414566a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Generate and Preview Rust Docs

on:
pull_request:
branches:
- main # Only generate docs for PRs targeting main
push:
branches:
- main
workflow_dispatch:

jobs:
generate-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
# app-path: zephyr-rust-lang
manifest-file-name: ci-manifest.yml
toolchains: arm-zephyr-eabi

- name: Install Rust Targets
shell: bash
run: |
rustup target add thumbv7em-none-eabi
rustup target add thumbv7m-none-eabi
- name: Setup cargo build
run: |
west build -b nrf52840dk/nrf52840 --camek-only docgen
find . -type d -ls
# - name: Build Rust documentation
# run: cargo doc --no-deps
# - name: Deploy docs to GitHub Pages for pull requests
# if: github.event_name == 'pull_request'
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./target/doc
# publish_branch: gh-pages
# publish_dir: ./target/doc
# destination_dir: pr-${{ github.event.number }}
#
# - name: Deploy docs to GitHub Pages for push to main
# if: github.event_name == 'push'
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./target/doc
# publish_branch: gh-pages

0 comments on commit 414566a

Please sign in to comment.