I suspect this is quite the long shot, but I figured I would throw it out there and see what I could find.
The company I contract for has been making WordPress sites for clients for a very long time. As a developer I like staying on the bleeding-edge of technology and I’m always looking for ways to make my workflow more pleasant and get a better end result. To that end, I’ve been reading a lot about Gatsby and I’ve been itching to try it out on a new project.
Running a Gatsby-generated front-end with a WordPress back-end seems like a great way to be able to use modern, clean, and intuitive code to build a site fast, without rocking the boat too much by suggesting a huge switch to a completely different platform or paradigm. Our editors and clients can stick with the CMS they know and are comfortable with, I can enjoy all the luxuries of React, and the end-users get a site that loads and responds lightning fast since everything is pre-generated static markup. Everybody wins!
The sticking point is that asking our clients to sign up for two different hosting services, and having to mess with DNS configuration, is a dealbreaker. Most of these clients come to us with a domain name already pointing to a cheap shared hosting plan on a Linux/PHP server, they give us FTP/database credentials, and we deploy from our own staging server when the site is approved. The ideal way for me to give this Gatsby thing a shot would be to have WordPress installed in a subdirectory on their server, with the Gatsby-generated files in the root, and — here’s where Netlify comes in — some way to automatically rebuild the static site whenever the WordPress is updated. I’ve read that Netlify can handle automatic rebuilding and deployment by responding to a webhook, but I really don’t want to have to host the front-end of the site on Netlify’s servers and the back-end somewhere else.
Is there any way to do what I’m trying to achieve here? I’d be fine with having a mirror of the front-end files on Netlify with some sort of script or function that automatically FTPs any changed files to the client’s production server on build — would that be a possibility? Or is there another solution that I’m not thinking of?