generated fromactions/typescript-action
- Notifications
You must be signed in to change notification settings - Fork0
Deploying a Node.js Project on a Remote Server via SSH
License
NotificationsYou must be signed in to change notification settings
lycpan233/ssh-deploy-nodejs
Use this GitHub action with your project
Add this Action to an existing workflow or create a new oneFolders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
支持在 Github Action 中,通过 SSH 链接远程服务器,执行命令。
ssh-deploy-nodejs 本项目基于node-ssh 实现
详情可参阅action.yml
host
- 远程服务器地址username
- 远程服务器用户名port
- 远程服务器端口, 默认 22password
- 远程服务器密码, password 和 privateKey 二选一privateKey
- 远程服务器私钥, password 和 privateKey 二选一workdir
- 指定工作目录source
- 需要上传的源文件地址destination
- 服务器的目标地址scripts
- 上传文件后需要执行的命令, 支持多行命令
name:Teston:push:branches: -releases/*jobs:deployment_test:name:Build and Deployruns-on:ubuntu-lateststeps: -name:Checkoutuses:actions/checkout@v4 -name:Setup Node.jsuses:actions/setup-node@v4with:node-version:"20.14.0" -name:Install dependenciesrun:| npm install -name:Compressed project filesrun:tar -zcvf ../release.tgz ./ -name:SSH Deploy Node.jsuses:./with:host:${{ secrets.HOST }}username:${{ secrets.USERNAME }}privateKey:${{ secrets.SSH_PEM }}source:"../release.tgz"destination:"/home/release.tgz"workdir:"/home"scripts:| rm -rf /home/app && mkdir /home/app tar -zxvf release.tgz -C /home/app && rm -rf release.tgz source ~/.zshrc && cd /home/app && npm start
About
Deploying a Node.js Project on a Remote Server via SSH
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.