2023-10-21 03:13:17 +02:00
|
|
|
name: Build Rust Docs
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "api/rust/**"
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "api/rust/**"
|
2023-10-21 04:24:00 +02:00
|
|
|
workflow_dispatch:
|
2023-10-21 03:13:17 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-01-22 06:47:49 +01:00
|
|
|
- name: Get protoc
|
|
|
|
run: sudo apt install protobuf-compiler
|
2023-10-21 03:13:17 +02:00
|
|
|
- name: Build docs
|
|
|
|
run: cd ./api/rust && cargo doc
|
|
|
|
- name: Create index.html
|
2024-02-18 06:57:02 +01:00
|
|
|
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=pinnacle_api\">" > ./target/doc/index.html
|
2023-10-21 03:13:17 +02:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2024-02-18 06:57:02 +01:00
|
|
|
publish_dir: ./target/doc
|
2023-10-21 03:13:17 +02:00
|
|
|
destination_dir: ${{ env.BRANCH_NAME }}/rust
|