Ghost supports a wide range of static site generators out of the box. Check out "Frontend Frameworks" - https://ghost.org/docs/api/v3/ where you can select from Next.js, Gatsby and many more ;)
For Wordpress there is the Simply Static plugin, and I think similar others.
There is also a productized version of the "Wordpress to a static site" idea - https://hardypress.com/ I'm using it and no complaints.