diff --git a/docs/.gitlab-ci.yml b/docs/.gitlab-ci.yml index b2a226e8f9b9d2b93c8a302780c2ae987cf8cd72..852544837d6e382fe971e3a602c492ae6af1e150 100644 --- a/docs/.gitlab-ci.yml +++ b/docs/.gitlab-ci.yml @@ -31,7 +31,7 @@ lint-documentation: tags: - docker-executor needs: - - job: build-documentation # Only run when documentation has been built + - job: build-documentation # Only run when documentation has been built artifacts: true before_script: @@ -40,3 +40,37 @@ lint-documentation: script: - vale $CI_PROJECT_DIR/docs/build/html/_sources + +##### Publish documentation artefacts +publish-documentation-1: + stage: documentation + # First deploy to prod-2 + tags: + - gap-docs-prod-2 + + only: + refs: + - main # Only publish when on the main branch + needs: + - job: lint-documentation # ... and after it has passed the linting pipeline + artifacts: true + + script: + - rm -r /var/www/gap-docs/* + - mv $CI_PROJECT_DIR/docs/build/html/* /var/www/gap-docs/ + - nginx -s reload + +publish-documentation-2: + stage: documentation + # When successful, also deploy to prod-1 + tags: + - gap-docs-prod-1 + + needs: + - job: publish-documentation-1 # Only run when publishing to prod-2 was successful + artifacts: true + + script: + - rm -r /var/www/gap-docs/* + - mv $CI_PROJECT_DIR/docs/build/html/* /var/www/gap-docs/ + - nginx -s reload