The error is as follows
❌ [Rsync] error:
Error: rsync exited with code 255
at ChildProcess. (//runner/work/_actions/easingthemes/ssh-deploy/main/dist/index.js:2:2603)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 255
}
❌ [Rsync] stderr:
rsync //runner/work/Web-Technologies/Web-Technologies/ @:*** –rsh “ssh -p 22 -i //runner/.ssh/deploy_key__1717742147641 -o StrictHostKeyChecking=no” –recursive –exclude= -rlgoDzvc -i
ssh: connect to host *** port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
❌️ [Rsync] stdout:
❌ [Rsync] command:
================================================================
Error: R] rsync exited with code 255
ssh: connect to host *** port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
and here is my full code. This is the first time I’m doing this and its very frustrating some one please help me.
name: Push-to-EC2
Trigger deployment only on push to main branch
on:
push:
branches:
– main
jobs:
deploy:
name: Deploy to EC2 on master branch push
runs-on: ubuntu-latest
steps:
- name: Checkout the files
uses: actions/checkout@v4
- name: Deploy to Server 1
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
TARGET: ${{ secrets.TARGET_DIR }}
- name: Executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
sudo apt-get -y update
sudo apt-get install -y apache2
sudo systemctl start apache2
sudo systemctl enable apache2
cd home
sudo mv * /var/www/html
I have tried to run it multiple times by taking help of chatgpt but it was not useful.
Jai Venkata Arun Akula is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.