1

Currently I have a Travis build that generates Doxygen documentation and then uploads this into a gh-pages branch on my GitHub. We also have a website that is currently being built from the master branch not gh-pages.

What I would like is a script to run after the Travis build passes that copies over the files from the gh-pages branch into a subfolder of our web files in master from which we can adjust the website to link to the documentation.

Is this possible or would it be easier to simply upload the documentation into master from the start?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

1

You can go on as is (upload the documentation in the gh-branch), but add one more step:

 git submodule update --remote

You can declare a branch content as submodule of another branch

git checkout master
git rm -r gh-pages # save your data first
git submodule add -b gh-pages -- /remote/url/of/your/own/repo
git commit -m "ADd gh-pages branch as submodule"
git push

Since that submodule will follow the latest commit of its own branch, a git submodule update --remote done in master will be enough to update the content of the gh-pages subfolder (root directory of the submodule).


Note: Since August 2016, you can publish your pages right from the master branch (not always the gh-pages branch)

That would simplify your issue.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Akhila Single folder indeed. So no multiple GitHub site possible, at least from what I understand. – VonC Mar 15 '21 at 13:21