0

I'm trying to publish a bookdown book to Netlify. It runs perfect locally, but I cannot deploy it to Netlify.

Github: https://github.com/OmarGonD/doctrina-test

What I've done is to download the bookdown-demo as a Zip and I've modified the contents.

The Deploy log says:

Error: Error building site: No source directory found, expecting to find it at /opt/build/repo/content

And according to this Hugo Forum the content directory must be added to the Github repository.

But in the Bookdown demo repository, I don't see any content folder in there.

What should I do?

Full deploy log:

10:11:22 PM: Build ready to start
10:11:23 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
10:11:23 PM: build-image tag: v3.3.2
10:11:23 PM: buildbot version: f71b4aa1b1ebc2bff806e48691024e0ab383dc02
10:11:23 PM: Fetching cached dependencies
10:11:24 PM: Starting to download cache of 101.9MB
10:11:24 PM: Finished downloading cache in 934.174652ms
10:11:24 PM: Starting to extract cache
10:11:27 PM: Finished extracting cache in 3.007482882s
10:11:27 PM: Finished fetching cache in 3.985523679s
10:11:27 PM: Starting to prepare the repo for build
10:11:28 PM: Preparing Git Reference refs/heads/master
10:11:33 PM: Starting build script
10:11:33 PM: Installing dependencies
10:11:35 PM: Started restoring cached node version
10:11:37 PM: Finished restoring cached node version
10:11:37 PM: v10.16.3 is already installed.
10:11:38 PM: Now using node v10.16.3 (npm v6.9.0)
10:11:38 PM: Attempting ruby version 2.6.2, read from environment
10:11:39 PM: Using ruby version 2.6.2
10:11:40 PM: Using PHP version 5.6
10:11:40 PM: Installing Hugo 0.18
10:11:41 PM: Hugo Static Site Generator v0.18 BuildDate: 2019-08-29T03:11:41Z
10:11:41 PM: Started restoring cached go cache
10:11:41 PM: Finished restoring cached go cache
10:11:41 PM: unset GOOS;
10:11:41 PM: unset GOARCH;
10:11:41 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
10:11:41 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
10:11:41 PM: go version >&2;
10:11:41 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
10:11:41 PM: go version go1.12 linux/amd64
10:11:41 PM: Installing missing commands
10:11:41 PM: Verify run directory
10:11:41 PM: Executing user command: hugo
10:11:41 PM: Started building sites ...
10:11:41 PM: Error: Error building site: No source directory found, expecting to find it at /opt/build/repo/content
10:11:41 PM: Skipping functions preparation step: no functions directory set
10:11:41 PM: Caching artifacts
10:11:41 PM: Started saving pip cache
10:11:41 PM: Finished saving pip cache
10:11:41 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
10:11:41 PM: Started saving emacs cask dependencies
10:11:41 PM: Finished saving emacs cask dependencies
10:11:41 PM: Started saving maven dependencies
10:11:41 PM: Finished saving maven dependencies
10:11:41 PM: Started saving boot dependencies
10:11:41 PM: Finished saving boot dependencies
10:11:41 PM: Started saving go dependencies
10:11:41 PM: Finished saving go dependencies
10:11:41 PM: Error running command: Build script returned non-zero exit code: 255
10:11:41 PM: Failing build: Failed to build site
10:11:41 PM: Finished processing build request in 17.884923232s
Omar Gonzales
  • 3,806
  • 10
  • 56
  • 120

1 Answers1

0

In order to go from source to the rendered output you need a R process with the bookdown package. That is not supported by Netlify (at the moment). However, you are already uploading the (locally) rendered book to GitHub in the _book sub-directory. This means you only have to tell Netlify that it should not try to build anything (empty "Build command") and publish the content of _book ("Publish directory" in "Build settings"). BTW, in this case there is not much gain by using Netlify over GitHub pages. If you change your output directory to docs, you can have the book published via that route.

In addition, you can use Travis CI to automatically build the book, so that you do not have to do that locally. See the build.sh and _deploy.sh scripts together with .travis.yml in the bookdown demo repository.

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75