diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6db11662729c72ced20469391057066e8d2ed38..566254c5b19c1d002a8de43828af7383ab3eda71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ -stages: [ build ] +stages: + - build + - publish -job_build: +build_guide: stage: build image: ubuntu:latest script: @@ -13,4 +15,22 @@ job_build: paths: - "angelguide_en.pdf" - "angelguide_de.pdf" - expire_in: 12 month \ No newline at end of file + expire_in: 12 months + +publish_artifacts: + stage: publish + image: ubuntu:latest + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - 'rsync -v angelguide_??.pdf $PUBLISHING_HOST:' + rules: + - if: '$CI_COMMIT_REF_NAME == "master"' + when: always + - when: never