Deploying truly static site (without build) from monorepo

Hi. I have a Yarn-based monorepo for deploying main services. To keep things together, there are also some purely static files that I want to deploy as a separate static site.

What bugs me, that Render will implicitly run yarn install presumably because it sees yarn.lock. Normally that would be fine, but I have some postinstall scripts which are important for the general flow, but don’t work with static content and causes deployment to fail. There is a yarn --ignore-scripts option, but it seems I cannot use it in the configuration.

So basically, I would need to instruct Render to either ignore the existence of yarn.lock or override the installation command. A good solution would if I could specify a working directory before any built-in checks kick in.

I am well aware that my setup is not ideal and I am kinda creating those problems for me, but I could not figure out better approach yet.

The only workaround I was able to figure out is creating a branch for static deployment where I’ve deleted package.json and setting that branch in Render configuration That worked flawlessly and the site went live in a matter of seconds, but it’s far from a good solution given it’s another branch that can become desync over time.

Hi @FredyC, have you tried using an empty build command for the site that’s just serving static files?

Of course, but as I said, Render will implicitly run yarn install no matter what’s configured in build command.

Right you are @FredyC. If you create an environment variable with SKIP_INSTALL_DEPS=true then Render won’t run yarn install. We’ll add documentation for this feature soon.

1 Like

Awesome, that worked flawlessly. Thank you!

2 Likes