Home
Support Forums

Only build and deploy changed sites

Hello

I got a question. Right now I build all my blog posts on every build with the Nuxt jamstack.
Is there a way to add only certain files to the published site.

For example that i only have to build the static file /posts/loremimsum.html and add this file to the deployed version. The other files which are not included in the new build should stay online.

Thank you for your time

Hi @Liechti,

Are you using manual deploys (drag-n-drop)? if yes, you’d have to drag the entire folder (old + new) files to the UI.

Hi @hrishikesh
No i build an deoloy on netlify.

In that case, I’m confused. Netlify builds the entire website, compares what changed from the previous build and publishes the changed files. That sounds like what you want to happen.

Could you describe the issue in a bit more detail?

Yes that is exactly what it is doing right now. But building around 700 blog posts every time eats up a lot of build minutes.

So i could configure my build to only build the latest post, what i already got working. But when deploying the old posts which are not included in the build will be deleted.

So what i want is that everything stays deployed and new files just get added. And if there are the same name they will be replaced.

That’s not how Nuxt works unfortunately, or does it?

From what I know about Nuxt, your run the command npm run build && npm run generate and Nuxt builds the entire website. Is there any way to tell Nuxt to only build a specific file?

If there’s, you’d have to take this workflow: Store the built files somewhere, next time to try to send a build command, configure the build to check from those files to see what’s already built and what’s not and build accordingly.

Maybe you would want to take a look at On Demand Builders: On-demand Builders | Netlify Docs

1 Like

In the Nuxt config you can configure the routes to be build dynamically.
I will try out this approach.

Thank you

1 Like