Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Add travis task to deploy docs #951

Closed huguestennier closed 5 years ago

huguestennier commented 5 years ago

What are you trying to accomplish with this PR?

Fix #917.

Related PR : https://github.com/Shopify/slate/pull/950

Contributing to docs should be as easy as commiting .md files for the maintainers.

We can leverage Travis CI to run the build commands and deploy on the gh-pages branch for us whenever we merge documentation change onto master.


The file is pretty straightforward, but some notes :

There's three condition to run the deploy ;

  1. If it's on the master branch
  2. Not a PR
  3. If there are files that were modified in the docs folder

Why was this approach chosen

Docusaurus has a built-in command docusaurus-publish specifically for our case. The problem is that since v0 isn't on Docusaurus, we have to work around and manually run the build command and copy the files over the gh-pages branch.

Future iterations

  1. It would be great if we could also check in the modified files were in v1 or v0 and only trigger the build necessary. Since the build process is fast (~2min for both) it doesn't really matter for now

  2. Instead of cloning the repo with a GitHub access token, we could leverage SSH connection but it's not an easy task over Travis.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.