rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.63k stars 1.61k forks source link

Netlify Support #1191

Closed Ramshandilya closed 4 years ago

Ramshandilya commented 4 years ago

Hi there,

I'm looking to publish my wiki build with mdbook on Netlify. I believe Netlify currently doesn't support Rust in its build images. I tweeted about this and @rustlang suggested we open an issue and take it from there. So here we are :)

jamesmunns commented 4 years ago

Hey! I've used netlify to publish with mdbook before. You can use the binary releases that mdbook has, and set that in your deploy settings. Under Build & Deploy > Continuous Deployment > Build Settings > Build command, I use the following command:

curl -L https://github.com/rust-lang/mdBook/releases/download/v0.3.3/mdbook-v0.3.3-x86_64-unknown-linux-gnu.tar.gz | tar xvz && ./mdbook build 

Then I set the publish directory to book (or whatever your mdbook is configured to).

steveklabnik commented 4 years ago

hey @Ramshandilya , thanks for actually doing this!

I was gonna suggest exactly what @jamesmunns was going to! Can you give it a try and let us know if it works for you?

Ramshandilya commented 4 years ago

Hi @steveklabnik Just tried @jamesmunns 's suggestion and it worked. Thank you so much! :)

PEZ commented 8 months ago

Don't know if @jamesmunns' way is still the way to do this. For me I also have some mdBook plugins and I really wanted Netlify to cache the build dependencies, so I build a dummy app specifying mdbook et al as build-dependencies, to get them cached. Full recipe here: https://blog.agical.se/en/posts/15-second-netlify-deploy-of-a-rust-mdbook/