1

I have this project with a gh-pages branch setup.

The web content inside of it was published via gh pages generator function.

https://mh-cbon.github.io/go-msi/

It s really just the README.md to index.html + layout.

Now i would like this web content to be synced with my updates.

As a matter of fact, gh pages functionality requires to go through the github web ui to trigger the build. Indeed, i made a test change on my readme, pushed it on master, but the published website remains the same. See the commit The test wording won t be find into the site

Q: how can i do to automatically triggers the rebuild of my pages ? Ideally, with just a call to a github api. Would like not to do a plain setup of jekyll. If not possible, can you provide a 3 steps command way to build the pages using a free theme and the README.md of my project ?

4 Answers4

0

You could use Travis CI or another CI system to do automatic updates to you gh-pages branch. This Github Gist has a complete and detailed explanation of the process. You can easily combine those instructions with these on how to restructure your index.html etc. to allow to Jekyll updates and automate everything.

I don't think that the raw Github Page Generator is available through the Github API, but I'm pretty sure that the Github Page Generator is just using Jekyll.

Community
  • 1
  • 1
StephenG
  • 2,851
  • 1
  • 16
  • 36
  • yes github does not provide such api. Or i misunderstood the doc [here](https://developer.github.com/v3/repos/pages/). Yes i intent to use travis to trigger the build. i have been through @domenic HOWTO, unfrotunately he won t explain the jekyll setup (he uses smthg named [ecmarkup](https://github.com/domenic/zones/blob/master/package.json#L7)). The SO you provided is way more promising. I ll try it and let you know. thanks! –  Jul 30 '16 at 16:30
  • Great. Let me know if you need anything else! Also look at https://github.com/2factorauth/twofactorauth if you need more travis inspiration. they don't publish via travis, but they do you it to check PRs to add to the site. acts a good example – StephenG Jul 31 '16 at 04:41
  • looks good! thanks. To be totally honest i ll go with gh access token encrypted for travis ;) –  Jul 31 '16 at 07:27
0

Only gh-pages branch content is published.

If you push to master branch this doesn't trigger the build for gh-pages branch.

If you want to update you published pages, you have to push to gh-pages.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
0

At http://agentscript.org, which is the gh-pages site for the repo for agentscript, I simply:

  • Created an automatic page via github's Automatic Generator
  • Replaced the static readme text in index.html with html generated by the current readme
  • ..By using a library that converts md to html.

I'm not sure if that's what you're looking for. I could supply more details if needed.

backspaces
  • 3,802
  • 6
  • 34
  • 58
  • 1
    This is a good pointer for dynamically loading your readme into any page you'd like: https://github.com/jayschwa/kissme My approach was similar but w/o jQuery and using a readme local to the page. But you get the idea. Good luck! – backspaces Aug 02 '16 at 21:13
  • 1
    Just FYI: I just completed doing this myself. Worked fine. Some details will vary such as getting around .gitignore .. you may want only core files (i.e. not transpiled etc) in your master, but a complete build in your gh-pages. But the basic idea works like a charm. – backspaces Aug 03 '16 at 22:08
0

thanks to all for your contributions, I ended implementing my own solution.

Basically its a bunch of sh scripts to execute over vagrant, docker, travis etc.

For now on I provided all you need to generate, with a vagrant box or a travis yaml, your gh-pages with the cayman theme like the github service does.

It is available at https://github.com/mh-cbon/gh-pages

The generated site is here

If you want to use another theme, you will need to ensure the jekyll configuration in _config.yml is correct.

You may also need to update the template files of the selected theme, at least for cayman theme i needed to.

All those adjustments are to implement into a config.jekyll.sh file to put on the root of your repository to generate.

That's it!