0
votes

I have a requirement for some very basic static file hosting, something that GitHub pages can easily handle - HTML & images only.

However the HTML and images are generate in a Travis-CI test script - so after the travis build is done, I want it to push a directory of artifacts back into Github.

Preferably into a git repo different to the one that triggered the build, but within the same GitHub organisation.

I know I can probably write a script that does the pull and push into the repo, but I'm unsure if I need to give travis extra keys or hooks.

Is this possible?

1
I think you'll find most your answers at stackoverflow.com/questions/26020494/… . - ocean
GitHub Pages offers static hosting if you are interested in going down that path. - osowskit
I know about static pages, I just want to know if I can uploaded to a set of static pages easily via Traivs-CI - user764357
I see. They added the ability to publish from a /docs folder. You can check in using a Deploy key. - osowskit

1 Answers

0
votes

Travis now supports deployment to github pages in a simplest way, see: https://docs.travis-ci.com/user/deployment/pages

An example that works for my repository (https://github.com/amadeubarbosa/openbus-collaboration-service):

# Install dependencies
addons:
  apt:
    packages:
      - doxygen
      - doxygen-doc
      - doxygen-latex
      - doxygen-gui
      - graphviz

script:
  - cd docs
  - doxygen collab.dox

deploy:
  provider: pages
  skip_cleanup: true
  local_dir: $TRAVIS_BUILD_DIR/docs/html
  github_token: $GITHUB_API_KEY
  on:
    branch: master

You must configure a github API Key to integrate Travis and Github, so Travis will push to gh-pages branch like a charm. Finally, you must configure your repository to show the pages from gh-pages branch.