Skip to content
Snippets Groups Projects
Commit dbaae104 authored by Christoph Knote's avatar Christoph Knote
Browse files

Conditional docs deploy job

parent ec21b3b7
No related branches found
No related tags found
1 merge request!24Prep for publish
......@@ -9,6 +9,7 @@ stages:
- build_package
- testing
- create_docs
- deploy
build_package:
stage: build_package
......@@ -34,6 +35,17 @@ create_docs:
- poetry install
- cd docs
- poetry run sphinx-build -b html . ../public
artifacts:
paths:
- public
deploy_docs:
stage: deploy
needs: [create_docs]
variables:
docs_upload_host: hosted-024-173.rz.uni-augsburg.de
docs_path_component: icartt
script:
# Following lines are ssh-agent setup and key injection, to allow upload of docs
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- 'command -v rsync >/dev/null || ( apt-get update -y && apt-get install --no-install-recommends rsync -y )'
......@@ -43,7 +55,7 @@ create_docs:
- echo "$docs_ssh_key" | tr -d ' ' | base64 --decode | ssh-add -
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan ${docs_upload_host} > ~/.ssh/known_hosts
- rsync -ax ../public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/
artifacts:
paths:
- public
- rsync -ax public/ ${CI_PROJECT_NAME}-docs@${docs_upload_host}:/srv/docs/${docs_path_component}/public/$(poetry version -s)/
rules:
# only deploy docs if the SSH key masked variable is set.
- if: $docs_ssh_key
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment