gitlab ci cd sample ssh
image: malikandemir/laravel-application:0.1.0
before_script:
- apt-get update -qq
- apt-get install -qq git
# Setup SSH deploy keys
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
deploy_staging:
stage: build
environment:
name: staging
url: example.com'
script:
- ssh user@host "cd /home/testpaysystem/ && git pull && npm run dev && exit"
only:
- main
2022-10-11 16:59:35