From d06eee87155cdc6702c0dc8fe933dc02d9efdada Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Thu, 22 Apr 2021 10:54:26 +0200 Subject: [WIP] Build doc in master and stable separately and have both versions on the website (#243) * add bild doc action workflow * new build * build full doc * remove github action and update circleci builder * add versions in doc and change dev number --- .circleci/config.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to '.circleci') diff --git a/.circleci/config.yml b/.circleci/config.yml index 9701ad1..29c9a07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: paths: - html - deploy: + deploy_master: docker: - image: circleci/python:3.6-jessie steps: @@ -113,6 +113,7 @@ jobs: git reset --hard origin/master git clean -xdf echo "Deploying dev docs for ${CIRCLE_BRANCH}."; + cd master cp -a /tmp/build/html/* .; touch .nojekyll; git add -A; @@ -122,16 +123,63 @@ jobs: echo "No deployment (build: ${CIRCLE_BRANCH})."; fi + deploy_tag: + docker: + - image: circleci/python:3.6-jessie + steps: + - attach_workspace: + at: /tmp/build + - run: + name: Fetch docs + command: | + set -e + mkdir -p ~/.ssh + echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config + chmod og= ~/.ssh/config + if [ ! -d ~/PythonOT.github.io ]; then + git clone git@github.com:/PythonOT/PythonOT.github.io.git ~/PythonOT.github.io --depth=1 + fi + - run: + name: Deploy docs + command: | + set -e; + if [ "${CIRCLE_BRANCH}" == "master" ]; then + git config --global user.email "circle@PythonOT.com"; + git config --global user.name "Circle CI"; + cd ~/PythonOT.github.io; + git checkout master + git remote -v + git fetch origin + git reset --hard origin/master + git clean -xdf + echo "Deploying dev docs for ${CIRCLE_BRANCH}."; + cp -a /tmp/build/html/* .; + touch .nojekyll; + git add -A; + git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM})."; + git push origin master; + else + echo "No deployment (build: ${CIRCLE_BRANCH})."; + fi + + workflows: version: 2 default: + jobs: - build_docs - - deploy: + - deploy_master: requires: - build_docs filters: branches: only: - master + - deploy_tag: + filters: + branches: + ignore: /.*/ + tags: + only: /[0-9]+(\.[0-9]+)*$/ \ No newline at end of file -- cgit v1.2.3