UPDATE, figured all this out, see bottom post, also I logged it all here for future reference.
Things I had to learn better
- Where Gatsby runs (reading code on Github for a bunch of Gatsby sites)
- What Netlify does (from Netlify docs)
- How to redefine my base URL as an HTTPS one (from Ghost docs)
Original post below
I’m trying to move my blog to Netlify, just for fun (and speed). It’s currently on DO Ubuntu 18.04, using Ghost 2.18.3 (just updated, hoping to resolve)
I’m struggling to get my website to deploy to Netlify. I’m not a total noob, but I really don’t get the flow. Been reading about headless CMS and jamstack and it’s going over my head.
- Installed Gatsby via npm
- Configured my git environment variables (name, email)
- Cloned the repository using
gatsby new hooshmand https://github.com/TryGhost/gatsby-starter-ghost.git
yarnfor dependencies (“already up to date”)
gatsby develop. Can’t access my server on 8000 because that’d require nginx reconfig… do I need to do this? It only is developing while I let it run…
I now click “deploy to netlify”, and I get taken to a github (which is authorized… tried this a few times).
I get to this URL: “https://app.netlify.com/start//hooshd/repos” which is “page not found”.
The double slash in “start//hooshd” looks suspect, so I change it to single, and get back to the deploy page, opting for continuous deployment; authorize again; now I can choose a number of repos to deploy from. But nothing “ghost” or “hooshmand” or “casper” or “gatsby” is among the projects, just my old code repos from various projects.
I’m missing something here, before even getting to webhooks
- Is the gatsby sever supposed to continuously run? Should I run it on a separate server to my ghost CMS? Answer as of 25/3: no it’s not. It’s a series of scripts hosted on Github.
- How does the HTML get pushed to my github repo, so that netlify then pulls it in? Answer as of 25/3: through gatsby, on github, that Netlify rebuilds.
Sorry I’m lost in the flow. (answer as of 25/3: still slightly lost)
I thought this would be something like
- Ghost back-end data changes
- Triggers a script which publishes new HTML using Gatsby (or whatever script) (correct, but I didn’t know where this was)
- HTML gets pushed to Netlify (correct)
That makes sense to me, so I’m confused about the role of Gatsby and Github.
I’ll summarize it all when I’m done! (done)