I am using Travis CI to build a site from this bookdown GitHub repo and deploy to the gh-pages branch. This approach mostly works, but I would like to use Netlify to show draft previews of pull requests too. So far, the Netlify deploy notifications are reacting to the incoming source files, not the HTML files that Travis is building. Netlify previews come in too early and the pages are blank.
Edit: the workflow
In this specific project, we have a bunch of source files that eventually generate the HTML files for the site. The master branch has the source only, and the gh-pages branch has the HTML only. I am using Travis to compile the HTML using the source on master and then push it to gh-pages. This works great for my own development because it automates the 10-minute site-generation process.
I was hoping to use Netlify to make enable site previews for pull requests, both from collaborators and external volunteers from the open source community. I picture something like the following.
- An external developer forks the source from the master branch of https://github.com/ropenscilabs/drake-manual and makes some changes.
- The developer then submits a pull request to merge the changed source files into the upstream master branch. The HTML was not necessarily generated in this process.
- Travis CI builds the HTML files from the fork, but since the pull request was not approved yet, it does not commit to
gh-pagesor push to GitHub. Instead, it sends the HTML files directly to Netlify. - Netlify receives the HTML, generates a preview, and notifies the GitHub pull request with an incominb webhook.
I realize that security restrictions on Travis environment variables make part of this impossible, and rightly so. But this is the kind of automated deployment I would like to reach eventually.
