Building Oxygen XML WebHelp Output on Travis CI
This topic assumes you have a DITA project hosted on a GitHub public or private repository.
The goal of this tutorial is to help you setup a Travis continuous integration job that automatically publishes your DITA project to GitHub pages after every commit. The published website will contain a feedback link on each page that would allow a contributor to easily suggest changes to the documentation by creating a pull request on GitHub with just a few clicks.
Enable the Travis CI Build
- Sign in to Travis CI with your GitHub account, accepting the GitHub access permissions confirmation.
- Once you are signed in, and you have synchronized your GitHub repositories, go to your profile page and enable Travis CI for the repository you want to build.
Configure the Travis CI Build in your GitHub Project
- Checkout your GitHub project locally.
- Copy the .travisfolder from here to the root directory of your project.
- In the root of your GitHub project, add a file called .travis.ymlwith the following content:language: dita install: - echo "Installed" script: - sh .travis/publish.sh after_success: - sh .travis/deploy.sh env: global: - DITAMAP=/path/to/your/ditamap/file - DITAVAL=/path/to/your/ditaval/file - ANT_OPTS=-Xmx1024MNoteReplace/path/to/your/ditamap/fileand/path/to/your/ditaval/filewith the appropriate paths to your DITA Map andditavalfiles.
- Create a GitHub personal access token by following this procedure.
- Define an environment variable in the repository
                     settings that has the name GH_TOKENand the value equal with the GitHub personal access token created earlier.
Register Your License Key
- Edit your .gitignorefile (or create it if it does not already exist) and add the following line:licenseKey.txt 
- Copy your WebHelp license to the root of your GitHub project in a file called
                     licenseKey.txt.ImportantThelicenseKey.txtfile should not be committed to GitHub as it contains a license key that is issued only to you.
- Encrypt the license key file and add it
                     to the .travis.ymlconfiguration file. This way only the Travis CI server will be able to decrypt it during the build process.
Commit to GitHub
- Commit the following files and folders and push the commit to GitHub:
                  git add .gitignore licenseKey.txt.enc .travis.yml .travis/ git commit -m "Set up the Travis CI publishing system" git push 
- Create a gh-pagesbranch in your GitHub project where the WebHelp output will be published. You can follow the procedure here.
