Commit 244054d5 authored by Frank's avatar Frank 🏃

Add task to deploy to the production server

parent 4374d865
Pipeline #35145140 failed with stage
in 33 seconds
......@@ -18,3 +18,35 @@ pages:
- public
only:
- master
production:
stage: deploy
environment:
name: production
url: https://www.fesevur.com
only:
- tags
- master
except:
- branches
before_script:
# Add the required packages
- apt-get update -qq && apt-get install -y -qq openssh-client rsync
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- 'echo "$SSH_PRIVATE_KEY_B64" | base64 -d | ssh-add -'
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
# Build the website
- bundle exec jekyll build
# Sync to the server
- rsync --recursive --verbose --compress --delete --checksum --chmod=Dg+s,ug+w,Fo-w,+X -e "ssh -p $TARGET_PRODUCTION_SSHPORT" _site/ "$TARGET_PRODUCTION_SSH:$TARGET_PRODUCTION_DIR"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment