24 lines
596 B
YAML
24 lines
596 B
YAML
stages:
|
|
- build
|
|
- test
|
|
- publish
|
|
- deploy
|
|
|
|
|
|
deploy:
|
|
stage: deploy
|
|
image: ubuntu
|
|
before_script:
|
|
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y --no-install-recommends )'
|
|
- eval $(ssh-agent -s)
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- echo "$SSH_CONFIG" > ~/.ssh/config
|
|
- chmod 644 ~/.ssh/config
|
|
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
|
|
- chmod 644 ~/.ssh/known_hosts
|
|
script:
|
|
- ssh blog "/home/gaugendre/blog/update"
|
|
only:
|
|
- master
|