Skip to content

Commit

Permalink
Refactor GitHub Actions workflow for documentation deployment: remove…
Browse files Browse the repository at this point in the history
… old workflow and implement a new streamlined process with Jekyll setup and improved build steps
  • Loading branch information
jamesatomc committed Jan 12, 2025
1 parent fef715a commit 906e178
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 78 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/deploy.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/deploy_book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy Documentation

on:
push:
branches: [main]
paths: ['documentation/**']

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/
~/.cargo/git/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install mdBook
run: cargo install mdbook mdbook-linkcheck

- name: Build Documentation
run: |
cd documentation/book
mdbook build
- name: Setup Jekyll structure
run: |
mkdir -p _site
cp -r documentation/book/book/* _site/
echo "theme: jekyll-theme-cayman" > _config.yml
echo "title: Kanari SDK Documentation" >> _config.yml
echo "description: Documentation for the Kanari SDK" >> _config.yml
echo "---" > _site/index.html.tmp
echo "layout: default" >> _site/index.html.tmp
echo "---" >> _site/index.html.tmp
cat _site/index.html >> _site/index.html.tmp
mv _site/index.html.tmp _site/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
enable_jekyll: true

0 comments on commit 906e178

Please sign in to comment.