diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee5b8bc3cc1f2338e476348c43108beaa7ed5c05..bedf6a6bba3c5fb7b5e422e976b696afc4aad956 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,8 @@ stages: - documentation - sonarqube - trigger_jenkins_build + - publish-prod-1 + - publish-prod-2 #################################### tox - Testing and linting run-tox-pipeline: @@ -43,22 +45,21 @@ run-tox-pipeline: paths: - htmlcov -##### Sphinx - Generate documentation +##### MkDocs - Generate documentation build-documentation: stage: documentation tags: - docker-executor - image: sphinxdoc/sphinx:latest + image: python:latest before_script: - - pip install sphinx_rtd_theme sphinxcontrib-jquery - - cd $CI_PROJECT_DIR/docs/source + - pip install mkdocs-material script: - - make html + - mkdocs build --site-dir public artifacts: paths: - - $CI_PROJECT_DIR/docs/build/html + - public ##### Vale - Documentation linter lint-documentation: @@ -74,11 +75,47 @@ lint-documentation: artifacts: true before_script: - - cd $CI_PROJECT_DIR/docs/vale + - cd $CI_PROJECT_DIR/vale - vale sync script: - - vale --glob='!*/migrations/*' $CI_PROJECT_DIR/docs/source $CI_PROJECT_DIR/gso + - vale --glob='!*/migrations/*' $CI_PROJECT_DIR/docs/ $CI_PROJECT_DIR/gso/ + +##### Publish documentation artefacts +publish-prod-2: + stage: publish-prod-2 + # First deploy to prod-2 + tags: + - gap-docs-prod-2 + + only: + refs: + - main # Only publish when on the main branch + needs: + - job: build-documentation + artifacts: true + + script: + - rm -rf /var/www/gap-docs/* + - mv $CI_PROJECT_DIR/public/* /var/www/gap-docs/ + +publish-prod-1: + stage: publish-prod-1 + # When successful, also deploy to prod-1 + tags: + - gap-docs-prod-1 + + only: + refs: + - main # Only publish when on the main branch + + needs: + - job: build-documentation + artifacts: true + + script: + - rm -rf /var/www/gap-docs/* + - mv $CI_PROJECT_DIR/public/* /var/www/gap-docs/ sonarqube: stage: sonarqube