Simple deploy via gitlab ci and ssh
- Create ssh key and add it to target server so you can login via the key
ssh-keygen -t ed25519 -C 'mydeploy@server' -f ./deploy_key
cat ./deploy_key.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
- Copy private key into gitlab-ci as variable named
SSH_DEV_PRIVATE_KEY
- Install docker and docker-compose on target server
ci, deploy, devops, gitlab — May 3, 2022