CV/.gitlab/ci/cv-gitlab-ci.yml

70 lines
1.5 KiB
YAML
Raw Normal View History

---
.use-cv-builder:
image: ${IMAGE_NAME}:master-cb8a29c7
.test-conditions:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- if:
changes:
- docker/Dockerfile
- __output/*
when: never
.publish-conditions:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_PATH == "dananglin/cv"'
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if:
changes:
- docker/Dockerfile
- __output/*
when: never
test:spellcheck:
before_script:
- apt-get update
- apt-get -y install aspell make
extends:
- .test-conditions
image: ubuntu:18.04
stage: test
script:
- make spellcheck
2020-02-07 16:05:30 +00:00
test:pdf:
artifacts:
expire_in: 1 hour
paths:
- __output/cv.pdf
extends:
- .use-cv-builder
- .test-conditions
2020-02-07 16:05:30 +00:00
stage: test
script:
- make clean pdf
2020-02-07 16:05:30 +00:00
publish:pdf:
extends:
- .use-cv-builder
- .publish-conditions
before_script:
- 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 0400 ~/.ssh/known_hosts
- git remote set-url origin git@gitlab.com:${CI_PROJECT_PATH}.git
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
stage: publish
script:
- make clean pdf
- git checkout master
- git add __output/cv.pdf
- 'git commit -m "auto: update CV."'
- git push origin master