[PYTHON] Compile Sphinx documentation with Wercker

Overview

English Here is a summary of the settings for compiling Sphinx documents with Wercker with screenshots.

procedure

Import the target repository from Create → Application of Wercker. The screen after import is as follows, so move to the Workflow tab.

2016-08-18-1.png

Open the build pipeline settings from among them.

2016-08-18-2.png

Scroll the build pipeline setting screen to display the Permission level item.

2016-08-18-3.png

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.

2016-08-18-4.png

Next, go back to the Workflow tab and create a new pipeline. 2016-08-18-5.png

Name the new pipeline deploy and make the hook type the default. The default is the setting to connect to the previous pipeline.

2016-08-18-6.png

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.

2016-08-18-7.png

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).

2016-08-18-8.png

After adding the GIT_TOKEN environment variable, change the Permission level to Execute pipelines and create a pipeline.

2016-08-18-9.png

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.

2016-08-18-10.png

Finally, it should be as follows.

2016-08-18-11.png

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

Compile Sphinx documentation with Wercker
Wercker step to compile Sphinx documentation
Automatically build Python documentation with Sphinx
Automatically create Python API documentation with Sphinx
Get started with the documentation tool Sphinx
Getting started with Sphinx. Generate docstring with Sphinx
Set python compile options with pyenv
Create Python project documentation in Sphinx