Commit 8efd4181 authored by Vít Kabele's avatar Vít Kabele

Automated deploy to production server

parent 2b59061d
Pipeline #32999028 failed with stage
in 1 minute and 28 seconds
image: jekyll/jekyll
image: registry.gitlab.com/avcsh/website
stages:
- deploy
#variables:
# JEKYLL_ENV: production
##
## Deploy to production via scp
## step by step following the https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor guide
##
prod:
stage: deploy
only:
- master
variables:
JEKYLL_ENV: production
before_script:
##
## 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
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
##
## Create the SSH directory and give it the right permissions
##
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
##
## Add known hosts to configuration file
##
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- bundle install
- jekyll build -d public/
- scp -r public/. [email protected]:~/www-autodeploy/.
pages:
stage: deploy
......
FROM jekyll/jekyll
RUN apk --update add openssh
\ No newline at end of file
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