Skip to content

Commit

Permalink
ci(docs): add GitHub Actions workflow for building and deploying docs
Browse files Browse the repository at this point in the history
- Create new workflow for generating and deploying documentation
  • Loading branch information
ShenMian committed Jan 23, 2025
1 parent 162eb4f commit 3c8b905
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docs

on:
push:
branches: [main]

env:
CARGO_TERM_COLOR: always

permissions:
contents: read
pages: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build docs
run: cargo doc --no-deps

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

0 comments on commit 3c8b905

Please sign in to comment.