Skip to content

Commit

Permalink
Add book
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Jul 7, 2024
1 parent 18a92fe commit cfd03ab
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Book
on:
push:
branches:
- main

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable
rustup default stable
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir bin
curl -sSL $url | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Run tests
run: mdbook test
working-directory: book

deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: mdbook build
working-directory: book
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'book/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,8 @@ Cargo.lock

# End of https://www.toptal.com/developers/gitignore/api/rust,node

# mdBook
book/book/

# Tailwind CSS ouput
tailwind.output.css
6 changes: 6 additions & 0 deletions book/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["Daniëlle Huisman"]
language = "en"
multilingual = false
src = "src"
title = "Rust Radix"
6 changes: 6 additions & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Summary

- [Colors](./colors/README.md)
- [Primitives](./primitives/README.md)
- [Components](./primitives/components/README.md)
- [Utilities](./primitives/utilities/README.md)
1 change: 1 addition & 0 deletions book/src/colors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Colors
1 change: 1 addition & 0 deletions book/src/primitives/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Primitives
1 change: 1 addition & 0 deletions book/src/primitives/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Components
1 change: 1 addition & 0 deletions book/src/primitives/utilities/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Utilities

0 comments on commit cfd03ab

Please sign in to comment.