මචන්. මම ඩිප්ලෝයිමන්ට් කරනවා github action වලින්. ගොඩක් aws servers. pem file තියන නිසා අවුලක් නෑ. ඒත් මට තව සර්වර් එකක් දුන්නා ඩෙප්ලොයිමන්ට් දාන්න. ඒක AWS නෙමෙයි තියෙන්නේ. dialog IDC එකේ virtual server එකක්. අනිත් aws servers වලට අවුලක් නෑ ගානට වැඩේ වෙනවා. ඒත් මේ සර්වර් එකට දාන්න බෑ Error එකක් එනවා. මම ඒක දන්නම් පහතින්. මම ඩිප්ලෝයි කරන්න යූස් කරන්නෙ github market place eken gaththu rsync module එකක්. මම ඒ සර්වර් එකේ අලුත් යූසර් කෙනෙක් හැදුවා deployer කියල.ඊටපස්සේ ඒ යූසර්ට ssh keys දැම්මා. මොකද මම යූස් කරන මොඩියුල් එකට අනිවා .PEM file එකක් දෙන්න ඔනේ. මට අලුතින් හම්බුන සර්වර් එක Password and username ගහලා ලොග් වෙන්න remote SSH කරන්න පුලුව්න්. ඒත් winscp කරන්න යද්දි server refesed our key කියලා එනවා. මම /etc/ssh/sshd_config file එකේ PubkeyAuthentication yes කරලා SSH restart කලා. හැබැයි අලුත් username and password වලින් ssh කරන්න පුලුවන් අවුලක් නැතුව. winscp එකෙනුයි github action එකෙනුයි තමා බැරි. chatGPT එකේ තිබ්බ ඒවත් try කලාට හරි ගියේ නෑ. මේකට මොකද්ද කරන්න පුලුව්න්?????
මම remote server එකෙ private key generate කලේ මෙකෙන් - "ssh-keygen -m PEM -t rsa -b 4096"
script:
error:
මම යූස් කරපු SSH module එක
https://github.com/easingthemes/ssh-deploy
මම remote server එකෙ private key generate කලේ මෙකෙන් - "ssh-keygen -m PEM -t rsa -b 4096"
script:
YAML:
name: Deploy to WAR files to github AWS LightSail
on:
push:
branches: main
jobs:
Get_code:
runs-on: ubuntu-20.04
steps:
- name: Get code
uses: actions/checkout@v4
- name: Getting deatails of the server
run: |
lscpu
free -h
- name: Go to folder
run: |
cd /home/runner/work/API-Service/API-Service
ls -l
- name: Deploy to the Dialer server.
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_TEST }}
SOURCE: "*"
REMOTE_HOST: "202.129.81.20"
REMOTE_PORT: "22"
REMOTE_USER: "deployer"
TARGET: "/opt/cicd_testing/api"
Code:
error:
Code:
Run easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ***
SOURCE: *
REMOTE_HOST: 202.129.81.20
REMOTE_PORT: 22
REMOTE_USER: deployer
TARGET: /opt/cicd_testing/api
ARGS: -rlgoDzvc -i
SSH_CMD_ARGS: -o StrictHostKeyChecking=no
[DIR] Creating /home/runner/.ssh dir in workspace root
✅ [DIR] dir created.
[FILE] writing /home/runner/.ssh/known_hosts file ... 0
✅ [SSH] known_hosts file ensured /home/runner/.ssh
✅ [DIR] /home/runner/.ssh dir exist
[FILE] writing /home/runner/.ssh/deploy_key_root_1696537420158 file ... 3243
✅ [SSH] key added to `.ssh` dir /home/runner/.ssh deploy_key_root_1696537420158
rsync version 3.1.3 protocol version 31
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, prealloc
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
✅️ [CLI] Rsync exists
[Rsync] Starting Rsync Action: /home/runner/work/API-Service/API-Service/* to [email protected]:/opt/cicd_testing/api
[Rsync] excluding folders
Warning: Permanently added '[202.129.81.20]:22' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Permission denied, please try again.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
❌ [Rsync] error:
Error: rsync exited with code 255
rsync /home/runner/work/API-Service/API-Service/* [email protected]:/opt/cicd_testing/api --rsh "ssh -p 22 -i /home/runner/.ssh/deploy_key_root_1696537420158 -o StrictHostKeyChecking=no" --recursive --exclude= -rlgoDzvc -i
at ChildProcess.<anonymous> (/home/runner/work/_actions/easingthemes/ssh-deploy/main/dist/index.js:2:2603)
at ChildProcess.emit (node:events:513:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) {
code: 255
}
❌ [Rsync] stderr:
Warning: Permanently added '[202.129.81.20]:22' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Permission denied, please try again.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
❌️ [Rsync] stdout:
❌ [Rsync] command:
================================================================
================================================================
Error: R] rsync exited with code 255
Warning: Permanently added '[202.129.81.20]:22' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Permission denied, please try again.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
මම යූස් කරපු SSH module එක
https://github.com/easingthemes/ssh-deploy
