Connect Localhost/admin to Github + Netlify

  • What version of Ghost are you using?
    Ghost-CLI version: 1.13.1
    Ghost version: 3.4.0

  • What configuration?

  • What steps could someone else take to reproduce the issue you’re having?

I have a ghost local installation, deployed the starter to my Github, added ContentAPI and netlify hooks according to the docs.
I have since changed the theme, removed Ghost as a staff member and added a post of my own. I have done this on http://localhost:2368/ghost/.

The netlify connection works. Every time there’s a change in the localhost/admin, a trigger is sent to rebuild the site.

In the screenshot above, you can see my github push (changed my ghost.json back to default values, minus the ContentAPI id - code below) and also triggered the netlify build (by changing the description of the site on my localhost/admin).

When running the site locally, all the changes are reflected. But none of the changes from the admin is reflected on the deployed site. What am I doing wrong or missing?

My ghost.json code:

{
“development”: {
“apiUrl”: “http://localhost:2368”,
“contentApiKey”: “[MY_CONTENT_API]”
},
“production”: {
“apiUrl”: “https://gatsby.ghost.io”,
“contentApiKey”: “9cc5c67c358edfdd81455149d0”
}
}

Hi @BadBrahmin :wave:. You need to connect your Netlify project with a production version of Ghost, aka Ghost installed on an actual domain. You’ll need to setup a live version on something like DigitalOcean :slight_smile:

1 Like

Awesome, thanks @DavidDarnes! That helped. I set up Ghost on Heroku and is now successfully deployed!

Follow-up question: I have uploaded the attila theme and it shows as active but the change is not reflected on the live site.

All the other changes from admin works but the theme.

I am not sure, but do you using Gatsby for your Netlify? If yes, then the theme you are uploading to Ghost will not work in your static site. Your theme change will effect your actual ghost site https://gatsby.ghost.io

2 Likes

Yes, the current setup is Gatsby + Netlify and Ghost + Heroku.

How can I have the theme reflect on my Gatsby site?

The Gatsby front-end you have setup will replace the Ghost theme layer. There’s a better explanation over here on our announcement post :slight_smile:

could you add ghost to heroku for free ? can you share some advices ? Thanks