使用 SSH 将构建部署到 Inmotionhosting 服务器

问题描述 投票:0回答:1

我在 Github 上运行了一个构建。构建完成后,我想将文件(DIST 目录内容)推送到我的共享主机中的文件夹中。

我遵循的步骤:

  1. 我已经设置了目录,并且该目录有一个实时 URL。
  2. 在Cpanel中,我创建了公钥和私钥。密钥已授权并转换为PPK格式。
  3. 我在 Git Hub 设置/秘密配置中有密钥和数据。
  4. 我有一个构建脚本和一个部署脚本。构建已成功运行并完成,但部署失败。

错误如下:

Run SamKirkland/web-deploy@v1
----------------------------------------------------------------
🚀 Thanks for using web deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a ⭐ on Github --> https://github.com/SamKirkland/web-deploy
or add a badge 🏷️ to your projects readme --> https://github.com/SamKirkland/web-deploy#badge
----------------------------------------------------------------
HOME /home/runner
GITHUB_WORKSPACE /home/runner/work/MYREPO/MYREPO
[SSH] Creating /home/runner/.ssh/known_hosts file in  /home/runner/work/MYREPO/MYREPO
✅ [SSH] file created.
✅ Ssh key added to `.ssh` dir  /home/runner/.ssh/web_deploy_key
/usr/bin/rsync -e ssh -p 2222 -i /home/runner/.ssh/web_deploy_key -o StrictHostKeyChecking=no --archive --verbose --compress --human-readable --progress --delete-after --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore ./ ***@***:***
<Buffer 6b 65 78 5f 65 78 63 68 61 6e 67 65 5f 69 64 65 6e 74 69 66 69 63 61 74 69 6f 6e 3a 20 72 65 61 64 3a 20 43 6f 6e 6e 65 63 74 69 6f 6e 20 72 65 73 65 ... 57 more bytes>
<Buffer 72 73 79 6e 63 3a 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 75 6e 65 78 70 65 63 74 65 64 6c 79 20 63 6c 6f 73 65 64 20 28 30 20 62 79 74 65 73 20 72 65 63 ... 93 more bytes>
kex_exchange_identification: read: Connection reset by peer
Connection reset by *** port 2222
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
Error: Error: The process '/usr/bin/rsync' failed with exit code 255
✅ Deploy Complete

我有以下部署代码脚本 main.yml:

on: push
name: Publish Website
jobs:
  web-deploy:
    name: 🚀 Deploy Website Every Commit
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get Latest Code
      uses: actions/checkout@v3
    
    - name: 📂 Sync Files
      uses: SamKirkland/web-deploy@v1
      with:
        target-server: ${{ secrets.HOST }}
        ssh-port: 2222
        remote-user: ${{ secrets.USERNAME }}
        private-ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
        destination-path:  ${{ secrets.PATH }}

有人知道我为什么会收到错误吗?

我也在使用 VUE3 和 Webpack。构建会在 Dist > JS 文件夹中生成大量 JS 文件。 我不知道如何设置它以使其生成一个或几个文件。

谢谢

git ssh deployment hosting
1个回答
0
投票

你能解决这个问题吗?

© www.soinside.com 2019 - 2024. All rights reserved.