每次提交到存储库时,我都想在我的远程服务器上部署我的 Nuxt.js 应用程序。这是我的 deploy.yml:
name: 'Deployment'
on:
push:
branches: ['master']
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Connect to SSH
uses: appleboy/ssh-action@master
with:
host: webhostgb.com
username: root
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
cd whgb-new
git pull origin master
npm run build
fuser -kn tcp 3000
pm2 restart deploy.sh
Run Code Online (Sandbox Code Playgroud)
基本上 deploy.sh 运行 npm start,但我使用 pm2 创建另一个进程而不是在 GitHub 操作进程中进行部署
10 分钟后我收到此错误,即使它做得很好:
err: 4bc06ed9a5a0b2fa431a.js 4.77 KiB 14 [emitted] [immutable] pages/products/tags/_slug
err: 7bf498872cde31ceb6dd.js 13.3 KiB 7 [emitted] [immutable] pages/docs/_slug/index …Run Code Online (Sandbox Code Playgroud)