1

Basically, I use travis-ci to locally build an entire site into /dist folder of master branch (but not upload to remote repo) and then deploy to gh-pages branch.

travis-ci supports pushing local-dir to target-branch: https://docs.travis-ci.com/user/deployment/pages/

My site consists of several independent sections, so I expect in future that I only build one section if changed and incrementally deploy to gh-pages without affecting other sections.

For example, /dist has two sections /dist/section_one and /dist/sections_two.

On master branch, I make modifications to /src/section_one, which will be built into /dist/section_one. Then I can push it to /section_one on gh-pages branch. Is this practical?

MoYummy
  • 809
  • 1
  • 8
  • 14

1 Answers1

0

One trick is to have one's master branch referencing the gh-pages content as a submodule, in a /gh-pages subfolder: see "Copying Doxygen Documentation from gh-pages branch into a subfolder of Master branch".

That way, Travis-ci can:

  • build /dist/section_one
  • copy the result in /gh-pages/section_one
  • add and commit and push within the /gh-pages subfolder
  • add and commit and push within the main repo root folder, in order to record the new SHA1 of the gh-pages subfolder submodule repo.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250