diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml new file mode 100644 index 00000000..8fbd828f --- /dev/null +++ b/.github/workflows/book.yml @@ -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 diff --git a/.gitignore b/.gitignore index f40f7a69..8b768b83 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/book/book.toml b/book/book.toml new file mode 100644 index 00000000..2a18cf05 --- /dev/null +++ b/book/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Daniƫlle Huisman"] +language = "en" +multilingual = false +src = "src" +title = "Rust Radix" diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md new file mode 100644 index 00000000..624dfa4c --- /dev/null +++ b/book/src/SUMMARY.md @@ -0,0 +1,6 @@ +# Summary + +- [Colors](./colors/README.md) +- [Primitives](./primitives/README.md) + - [Components](./primitives/components/README.md) + - [Utilities](./primitives/utilities/README.md) diff --git a/book/src/colors/README.md b/book/src/colors/README.md new file mode 100644 index 00000000..302161a2 --- /dev/null +++ b/book/src/colors/README.md @@ -0,0 +1 @@ +# Colors diff --git a/book/src/primitives/README.md b/book/src/primitives/README.md new file mode 100644 index 00000000..564479a2 --- /dev/null +++ b/book/src/primitives/README.md @@ -0,0 +1 @@ +# Primitives diff --git a/book/src/primitives/components/README.md b/book/src/primitives/components/README.md new file mode 100644 index 00000000..0eac4eb5 --- /dev/null +++ b/book/src/primitives/components/README.md @@ -0,0 +1 @@ +# Components diff --git a/book/src/primitives/utilities/README.md b/book/src/primitives/utilities/README.md new file mode 100644 index 00000000..909e9dbd --- /dev/null +++ b/book/src/primitives/utilities/README.md @@ -0,0 +1 @@ +# Utilities