我在 Github 上运行了一个构建。构建完成后,我想将文件(DIST 目录内容)推送到我的共享主机中的文件夹中。
我遵循的步骤:
错误如下:
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 文件。 我不知道如何设置它以使其生成一个或几个文件。
谢谢
你能解决这个问题吗?