.gitlab-ci.yml 1.14 KiB
stages:
- build
- publish
.template:build_guide:
stage: build
image: alpine
before_script:
- apk update
- apk add --no-cache ruby asciidoctor git
- gem install asciidoctor-pdf --pre
artifacts:
paths:
- "angelguide_en.pdf"
- "angelguide_de.pdf"
expire_in: 12 months
build_guide_by_tag:
extends: .template:build_guide
script:
- ./build.sh $CI_COMMIT_TAG
rules:
- if: $CI_COMMIT_TAG != null
when: always
build_guide:
extends: .template:build_guide
script:
- ./build.sh $CI_COMMIT_SHORT_SHA
rules:
- if: $CI_COMMIT_TAG == null
when: always
publish_guide:
stage: publish
image: kroniak/ssh-client
before_script:
- apk update
- apk add --no-cache rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo -n "$SSH_PRIVATE_KEY" | ssh-add -
- ssh-keyscan -H "$PUBLISH_HOST" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- 'rsync -av angelguide_*.pdf $PUBLISH_USER@$PUBLISH_HOST:$PUBLISH_PATH'
rules:
- if: '$CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG != null'
when: on_success
- when: never