forked from nipy/dmriprep
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nipy#45 from oesteban/docs/build-documentation
DOC: Build versioned docs and deploy them to gh-pages
- Loading branch information
Showing
28 changed files
with
2,843 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
docs_deploy: &docs | ||
docker: | ||
- image: node:8.10.0 | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: docs/_build | ||
- run: | ||
name: Disable jekyll builds | ||
command: touch docs/_build/html/.nojekyll | ||
- run: | ||
name: Install and configure dependencies | ||
command: | | ||
npm install -g --silent [email protected] | ||
git config user.email "[email protected]" | ||
git config user.name "ci-build" | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "29:00:83:05:e9:af:5d:0f:3b:18:7a:3f:0a:98:1a:ef" | ||
- run: | ||
name: Deploy docs to gh-pages branch | ||
command: gh-pages --dotfiles --message "doc(update) [skip ci]" --dist docs/_build/html | ||
|
||
version: 2 | ||
jobs: | ||
|
||
|
@@ -437,6 +460,64 @@ jobs: | |
steps: | ||
- run: echo Deploying! | ||
|
||
build_docs: | ||
docker: | ||
- image: python:3.7.4 | ||
environment: | ||
- FSLOUTPUTTYPE: NIFTI | ||
- SUBJECTS_DIR: /tmp/subjects | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- docs-v1-{{ .Branch }}-{{ .Revision }} | ||
- docs-v1-{{ .Branch }}- | ||
- docs-v1-master | ||
- docs-v1- | ||
paths: | ||
- ./docs/_build/_html | ||
- checkout | ||
- run: | ||
name: Create subjects folder | ||
command: mkdir -p $SUBJECTS_DIR | ||
- run: | ||
name: Install Graphviz | ||
command: apt update && apt -y install graphviz | ||
- run: | ||
name: Install deps | ||
command: pip install --no-cache-dir -r docs/requirements.txt | ||
- run: | ||
name: Build only this commit | ||
command: make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html | ||
- store_artifacts: | ||
path: ./docs/_build/no_version_html | ||
- run: | ||
name: Generate Versioned Docs | ||
command: | | ||
set +e | ||
force_versioned="$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[docs?[ _]?versions?\]' )" | ||
set -e | ||
if [[ "x${CIRCLE_TAG}" = "x" && "${CIRCLE_BRANCH}" != "master" && "x${force_versioned}" = "x" ]]; then | ||
echo "Not a tag or master branch - skipping versioned docs." | ||
circleci step halt | ||
else | ||
make -f ./docs/Makefile versioned CURBRANCH=${CIRCLE_TAG:-$CIRCLE_BRANCH} | ||
fi | ||
- save_cache: | ||
key: docs-v1-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- ./docs/_build/_html | ||
- persist_to_workspace: | ||
root: docs/_build | ||
paths: html | ||
- store_artifacts: | ||
path: ./docs/_build/html | ||
|
||
deploy_docs_tag: | ||
<<: *docs | ||
|
||
deploy_docs_master: | ||
<<: *docs | ||
|
||
workflows: | ||
version: 2 | ||
build_test_deploy: | ||
|
@@ -490,6 +571,7 @@ workflows: | |
- deployable: | ||
requires: | ||
- build | ||
- build_docs | ||
- test_deploy_pypi | ||
filters: | ||
branches: | ||
|
@@ -514,3 +596,31 @@ workflows: | |
ignore: /.*/ | ||
tags: | ||
only: /.*/ | ||
|
||
- build_docs: | ||
filters: | ||
branches: | ||
ignore: | ||
- /tests?\/.*/ | ||
- /THP002\/.*/ | ||
tags: | ||
only: /.*/ | ||
|
||
- deploy_docs_master: | ||
requires: | ||
- build_docs | ||
- test_deploy_pypi | ||
filters: | ||
branches: | ||
only: /master/ | ||
tags: | ||
ignore: /.*/ | ||
|
||
- deploy_docs_tag: | ||
requires: | ||
- deployable | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ instance/ | |
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/api/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.