Search code examples
rblogdownnetlify

Deploy fail status on Netlify but site still deploys


I am using blogdown to make my first site and am trying to follow the instructions for deployment in the online documentation for blogdown[here]

This is what I understood from the documentation, build the site in RStudio and copy the contents of the public folder in a git repository. The repository sn248.github.io used to contain the contents for my jekyll based static web page and was hosted using Github pages. It had only a few posts, which I am planning to manually convert into blogdown based webite.

I do see my new website with the theme I want, but I am worried about the deploy failed message I see on Netlify (below)

12:09:21 AM: Installing Hugo 0.30
12:09:24 AM: Error: Unable to locate Config file. Perhaps you need to create a new site.
       Run `hugo help new` for details. (Config File "config" Not Found in "[/opt/build/repo]")
12:09:25 AM: Build complete: exit code: 255
12:09:25 AM: Cleaning up docker container
12:09:25 AM: Error running command: Build script returned non-zero exit code: 255
12:09:26 AM: An error occurred while building the site, skipping the deploy and cache refresh.
12:09:26 AM: Build script returned non-zero exit code: 255
12:09:26 AM: Finished processing build request in 13.85761953s

I have specified my Build command:as hugo and my Publish Directory: as public. I have tried with the HUGO_VERSION 0.24.1 (as shown in the documentation) also but got the same result. Looking at the error message it seems I am missing a basic step here. But I also don't understand how anything got built if the Config file was not located.

Link to my Git repo

Link to my Site

Any help here would be highly appreciated, thanks! SN248


Solution

  • Your Github repo contains a prebuilt website, and you should not use hugo to build it again on Netlify. Please read the documentation on Netlify in the blogdown book. To quote the relevant part in the book:

    [...] you can certainly prebuild your website using any tools, push it to GitHub, and Netlify is still able to deploy it for you. What you need to do is to leave the build command empty, and tell Netlify your publish directory (e.g., Hugo's default public/, but if your prebuilt website is under the root directory, specify . as the publish directory instead).