pinnacle/.github/workflows/rustdoc.yml

35 lines
896 B
YAML
Raw Normal View History

name: Build Rust Docs
on:
pull_request:
branches:
- main
paths:
- "api/rust/**"
push:
branches:
- main
paths:
- "api/rust/**"
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
- name: Build docs
run: cd ./api/rust && cargo doc
- name: Create index.html
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=pinnacle_api\">" > ./api/rust/target/doc/index.html
- name: Deploy
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api/rust/target/doc
destination_dir: ${{ env.BRANCH_NAME }}/rust