diff options
author | RĂ©mi Flamary <remi.flamary@gmail.com> | 2021-04-22 10:54:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 10:54:26 +0200 |
commit | d06eee87155cdc6702c0dc8fe933dc02d9efdada (patch) | |
tree | 99c35c70fcd193cd463d01c0c33aabd189035f16 /.circleci/config.yml | |
parent | 0d995011b19b243bc980588cd98786b7c41a0509 (diff) |
[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
Diffstat (limited to '.circleci/config.yml')
-rw-r--r-- | .circleci/config.yml | 52 |
1 files changed, 50 insertions, 2 deletions
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 |