travis: Publish sphinx docs to Github pages
diff mbox series

Message ID 20190607031147.3143-1-sam@mendozajonas.com
State Accepted
Headers show
Series
  • travis: Publish sphinx docs to Github pages
Related show

Commit Message

Samuel Mendoza-Jonas June 7, 2019, 3:11 a.m. UTC
Use Travis to build and publish the Sphinx docs automatically.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
In particular on the open-power/petitboot repository this will publish
the docs to https://open-power.github.io/petitboot/
It's not on ozlabs.org but it is the next best place and very easy to
set up :)

 .travis.yml | 18 ++++++++++++++++++
 doc/conf.py |  3 +--
 2 files changed, 19 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/.travis.yml b/.travis.yml
index cff60dce..52566286 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,11 +8,29 @@  matrix:
   include:
     - os: linux
       name: "linux"
+      env: DOCS="true"
     - os: linux-ppc64le
       name: "linux-ppc64le"
 
+addons:
+  apt:
+    packages:
+      - python-pip
+
 before_script:
  - ./docker/build-builder
 
+install:
+ - "sudo pip install sphinx"
 script:
  - ./docker/build-pb --check --verbose --configure-opts "--enable-platform-arm64 --enable-platform-powerpc"
+ - if [ "$DOCS" == "true" ]; then cd doc/; make html; fi
+
+deploy:
+  provider: pages
+  skip-cleanup: true
+  github-token: $GITHUB_TOKEN
+  local_dir: "doc/_build/html"
+  on:
+    branch: master
+    condition: "$DOCS = true"
diff --git a/doc/conf.py b/doc/conf.py
index 2403c1db..ecef3043 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -30,8 +30,7 @@  release = 'v1.10.3'
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = [
-]
+extensions = ['sphinx.ext.githubpages']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']