@@ -385,6 +385,112 @@ jobs:
385385 - store_artifacts :
386386 path : packages/python/plotly/dist
387387
388+
389+ build-doc :
390+ resource_class : xlarge
391+ docker :
392+ # specify the version you desire here
393+ # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
394+ - image : circleci/python:3.6.8-node
395+
396+
397+ working_directory : ~/project
398+
399+ steps :
400+ - add_ssh_keys :
401+ fingerprints :
402+ - " d9:b0:da:5c:3e:8c:b6:b6:d5:b6:35:70:ce:fe:f5:b1"
403+
404+ - checkout
405+
406+ # Download and cache dependencies
407+ - restore_cache :
408+ keys :
409+ - v1-dependencies-{{ checksum "doc/requirements.txt" }}
410+ # fallback to using the latest cache if no exact match is found
411+ - v1-dependencies-
412+
413+ - run :
414+ name : install dependencies
415+ command : |
416+ cd doc
417+ python3 -m venv venv
418+ . venv/bin/activate
419+ npm install electron@1.8.4
420+ npm install orca
421+ pip install -r requirements.txt
422+ if [ "${CIRCLE_BRANCH}" == "master" ]; then
423+ pip uninstall plotly
424+ cd ../packages/python/plotly
425+ python3 setup.py install
426+ cd ../../../doc
427+ fi
428+ echo 'export PATH="/home/circleci/project/doc/node_modules/.bin:$PATH"' >> $BASH_ENV
429+ sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2
430+ cd ..
431+
432+ - save_cache :
433+ paths :
434+ - ./doc/venv
435+ - ./doc/node_modules
436+ key : v1-dependencies-{{ checksum "doc/requirements.txt" }}
437+
438+ - run :
439+ name : make html
440+ command : |
441+ cd doc
442+ . venv/bin/activate
443+ echo ${mapbox_token} > python/.mapbox_token
444+ make -kj8 || make -kj8
445+ curl https://raw.githubusercontent.com/plotly/documentation/source-design-merge/front-matter-ci.py > front-matter-ci.py
446+ curl https://raw.githubusercontent.com/plotly/documentation/source-design-merge/check-or-enforce-order.py > check-or-enforce-order.py
447+ python front-matter-ci.py build/html
448+ python check-or-enforce-order.py build/html
449+ if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
450+ cd build/html
451+ git init
452+ git config user.name nicolaskruchten
453+ git config user.email nicolas@plot.ly
454+ git add *
455+ git commit -m build
456+ git push --force git@github.com:plotly/plotly.py.git master:built
457+ rm -rf .git
458+ cd ../..
459+ fi
460+ tar -zcf build/html.tgz build/html
461+ rm -rf build/html build/ipynb
462+ cd ..
463+
464+ - run :
465+ name : make doc
466+ command : |
467+ cd doc
468+ . venv/bin/activate
469+ cd apidoc
470+ make html
471+ if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
472+ cd _build/html
473+ touch .nojekyll
474+ git init
475+ git config user.name emmanuelle
476+ git config user.email emma@plot.ly
477+ git add *
478+ git add .nojekyll
479+ git commit -m build
480+ git push --force git@github.com:plotly/plotly.py-docs.git master:gh-pages
481+ rm -rf .git
482+ cd ../..
483+ fi
484+
485+ cd ../..
486+
487+
488+ - store_artifacts :
489+ path : doc/build
490+ destination : doc/build
491+
492+
493+
388494workflows :
389495 version : 2
390496 code_formatting :
@@ -413,3 +519,4 @@ workflows:
413519 - python-2-7-orca
414520 - python-3-5-orca
415521 - python-3-7-orca
522+ - build-doc
0 commit comments