1
Fork 0
lorchess.ru/.gitlab-ci.yml

34 lines
798 B
YAML
Raw Normal View History

2018-10-28 19:46:33 +04:00
image: ruby:2.5-alpine
variables:
JEKYLL_ENV: production
LC_ALL: en_US.UTF-8
build site:
stage: build
2018-10-28 21:18:07 +04:00
before_script:
- apk add --no-cache g++ musl-dev make
- apk add --no-cache libstdc++
- bundle install --path=vendor/
2018-10-28 19:46:33 +04:00
script:
2018-10-28 20:51:58 +04:00
- bundle exec jekyll build -d lorchess.ru
2018-10-28 21:22:27 +04:00
artifacts:
untracked: true
expire_in: 4 hours
paths:
- lorchess.ru
2018-10-28 21:14:17 +04:00
deploy site:
stage: deploy
only:
- master
before_script:
2018-10-28 21:18:07 +04:00
- apk add --no-cache openssh-client
2018-10-28 21:14:17 +04:00
- mkdir -p ~/.ssh
- echo "$DEPLOY_SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H $DEPLOY_SSH_HOST >> ~/.ssh/known_hosts
script:
- scp -r lorchess.ru $DEPLOY_SSH_USER@$DEPLOY_SSH_HOST:$DEPLOY_PATH