diff --git a/.github/workflows/ec2-deployment.yml b/.github/workflows/ec2-deployment.yml index 3a6513d5a141..b28f9ea3be6d 100644 --- a/.github/workflows/ec2-deployment.yml +++ b/.github/workflows/ec2-deployment.yml @@ -19,8 +19,13 @@ jobs: USERNAME: ${{ secrets.USERNAME }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} run: | - echo "$SSH_PRIVATE_KEY" > private_key && chmod 600 private_key - ssh -o StrictHostKeyChecking=no -i private_key ${USERNAME}@${HOST} ' + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -H "$HOST" >> ~/.ssh/known_hosts + + ssh -o StrictHostKeyChecking=no $USERNAME@$HOST << EOF + source ~/.nvm/nvm.sh node -v cd ~/frappe-bench/apps/erpnext git pull @@ -30,4 +35,4 @@ jobs: sudo kill -9 \$(sudo lsof -t -i:13000) screen bench start - ' \ No newline at end of file + EOF \ No newline at end of file