Update GitHub Pages Via Travis CI And Maven Site

less than 1 minute read

I’ve been looking for a way to automatically update my github pages site via a maven build hosted on travis-ci.

There is a ‘com.github.github.site-maven-plugin’ which supports publishing the content of the maven site to the gh-pages branch of a project.


  1. Maven Site Setup

I need to add a site.xml to my project to configurate the generated site. I then updated the xslt plugin to write the generated cv.html file within the ‘target/site’ folder. I renamed cv.xml to index.xml so that the final html page remains the same.

2 - GitHub Oauth Token

Via the Github > Settings > Authentication admin panel i created a new Oauth token.



3 - Travis CI

I registered the ‘github.global.oauth2Token’ value via the Settings > Env_Vars panel of my travis-ci account.




Leave a Comment