Kayote
Kayote

Reputation: 15627

How to deploy latest changes to github pages from Gatsby

I followed the guide as per this link at gatsby docs.

Everything went well & the site was hosted at github-pages. However, all the subsequent changes in my master branch are not being pushed to gh-pages branch. Github branches pages shows that the 'gh-pages' branch is ahead by 12 commits & behind master by 21 commits.

I understand the 'gh-pages' branch is production branch for deployment, so I cannot simply merge master into 'gh-pages'.

Can someone please clarify what is 'gh-pages' branch being built & deployed from? How do I get 'gh-pages' in sync with the master branch.

Thanks

Upvotes: 2

Views: 491

Answers (1)

Andy Theos
Andy Theos

Reputation: 3346

Github is building/deploying to gh-pages from the source branch that you can set in settings. Actually there is a mention about it in gatsby docs you provided:

If this is not successful, make sure that gh-pages is set as the source branch in your repository’s Settings -> GitHub Pages and then re-run npm run deploy.

As for syncing: you can mirror gh-pages with master, but i'd rather use any of these branches straight up, without syncing, just treat the branch in GH pages settings as your main and "production-like" branch.

Upvotes: 1

Related Questions