From f5d7c84f2b484ca7fad19f981a3f808626e2a0b4 Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Thu, 3 Dec 2020 17:53:19 +0100 Subject: [PATCH] WIP: CircleCI doc building --- .circleci/config.yml | 48 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffcefe8a73..6fd3c37876 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,7 +155,6 @@ orbs: tools/circleci-prepare-log-dir.sh if [ -n "${AWS_SECRET_ACCESS_KEY}" ]; then tools/circleci-upload-to-s3.sh; fi - package: parallelism: 1 machine: @@ -179,6 +178,7 @@ orbs: name: Build package command: | KEEP_COVER_RUNNING=1 ./tools/travis-test.sh -p pkg -s false + big_tests: parallelism: 1 machine: @@ -261,6 +261,7 @@ orbs: command: | tools/circleci-prepare-log-dir.sh if [ -n "${AWS_SECRET_ACCESS_KEY}" ]; then tools/circleci-upload-to-s3.sh; fi + docker_image: parallelism: 1 machine: @@ -287,6 +288,46 @@ orbs: name: Execute Docker image build and upload command: tools/circle-build-and-push-docker.sh +jobs: + docs_build_deploy: + parallelism: 1 + docker: + - image: cimg/python:3.9.0 + working_directory: ~/app + steps: + - checkout + - run: + name: Test that docs build + command: | + pip3 install mkdocs + pip3 install mkdocs-material + mkdocs build --strict + - when: + condition: + or: + - equal: [ master, << pipeline.git.branch >> ] + - << pipeline.git.tag >> + steps: + - add_ssh_keys: + fingerprints: + - "${GH_DEPLOY_KEY}" + - run: + name: Generate image tag + command: | + set -x + if [ -n "$CIRCLE_TAG" ]; then + DOCS_TAG="$CIRCLE_TAG" + elif [ "$CIRCLE_BRANCH" == "master" ]; then + DOCS_TAG="latest" + else + DOCS_TAG=`echo $CIRCLE_BRANCH | sed 's,/,_,g'` + fi + - run: + name: Build latest + command: | + pip3 install mike + mike deploy $DOCS_TAG --remote git@github.com:esl/MongooseDocs.git --branch main --push --force + filters: &all_tags tags: only: /^\d+\.\d+\.\d+([a-z0-9\-\+])*/ @@ -457,3 +498,8 @@ workflows: - small_tests_21_3 - small_tests_23 filters: *all_tags + # ============= DOCUMENTATION ============= + - docs_build_deploy: + name: build_and_deploy_docs + context: mongooseim-org + filters: *all_tags