Skip to content

Commit

Permalink
add docs.yml github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hozan23 committed Nov 22, 2023
1 parent d4c8251 commit 8981f3d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Deploy Rust API Docs

on:
push:
branches:
- test-ci-docs

jobs:
docs:
name: build karyons rust api docs
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive

- name: Get date for registry cache
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Cargo registry cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ steps.date.outputs.date }}

- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all --document-private-items

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: gh-pages
force_orphan: true
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
build_and_test:
name: Rust project - latest
name: karyons - latest
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down

0 comments on commit 8981f3d

Please sign in to comment.