Search code examples
githubtravis-cigithub-pages

Publishing built files to gh-pages with Travis CI


For this repository I'm trying to publish the built files using Travis CI.

I'm following these instructions. IIUC setting skip_cleanup to true should make Travis also publish the target folder containing the built resources, however I don't see these resources. Thoughts?


Solution

  • I had to delete the target folder from .gitignore in order to get the travis commit to gh-pages to work. Not ideal because target resources should not be pushed to the master branch. There's a Travis issue tracking it here.

    Update

    The end game solution ended up being adding this to my travis configuration:

    before_deploy:
        - sed -i '/target/d' .gitignore
    

    That will cause Travis to delete the target folder from .gitignore right before attempting the deploy to github pages. This is OK because it's only done on the Travis end, and not in the master branch on the github end. Full sample travis configuration here.