You can add the public key indicated by the fingerprint like this:
- add_ssh_keys
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "circle_2_deploy" ]; then
echo '<hostname> <type> <key>' >> ~/.ssh/known_hosts
scp -oStrictHostKeyChecking=no -r /home/ubuntu/mdph/dist/. ${DEPLOY_USER}@${DEPLOY_SERVER}:${DEPLOY_DIR}/.
fi
By your example, hostname would be ${DEPLOY_SERVER}, type is the type of SSH key (ssh-rsa, ecdsa-sha2-nistp256, etc), and key is the public key of hostname.