Here is a summary of the settings for compiling Sphinx documents with Wercker with screenshots.
Import the target repository from Create → Application of Wercker.
The screen after import is as follows, so move to the Workflow tab.
Open the build pipeline settings from among them.
Scroll the build pipeline setting screen to display the Permission level item.
And Permission level prevents others from running the pipeline,
Also, select ʻexecute pipelineso that the log is not published carelessly. Also, addgh-pages to ʻIgnore branches.
If you forget this, you will push the document to gh-pages and then compile again.
Next, go back to the Workflow tab and create a new pipeline.

Name the new pipeline deploy and make the hook type the default. The default is the setting to connect to the previous pipeline.
To upload the compiled document to GitHub
Register the access token to GitHub as an environment variable in this pipeline.
Set the environment variable name to GIT_TOKEN and check the protected option.
GitHub tokens can be obtained from https://github.com/settings/tokens.
For public repositories, you only need to check public_repo.
For private repositories, you may need to check repo (not tried).
After adding the GIT_TOKEN environment variable, change the Permission level to Execute pipelines and create a pipeline.
Next, connect the deploy pipeline created earlier to build to create a new workflow.
Also, edit On branch (es) so that it works only when you push it to master.
Finally, it should be as follows.
Finally, add wercker.yml to the repository.
For example, if you compile the source in the docs folder with Sphinx, the wercker.yml will look like this:
wercker.yml
box: jkawamoto/ghp-box
build:
steps:
- jkawamoto/sphinx:
basedir: docs
packages: sphinx_rtd_theme
deploy:
steps:
- jkawamoto/ghp-import:
token: $GIT_TOKEN
basedir: docs/build/html
In this example, sphinx_rtd_theme is used.
It is assumed that the compiled document will be generated in docs / build / html.
If not, edit basedir to suit your environment.
See below for a description of boxes and steps.
Recommended Posts