-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.02 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Deploy Wechat bot
on:
push:
branches:
- main
paths-ignore:
- LICENSE
- README.md
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 下载机器人源码
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
source: "./"
target: "/home/ubuntu/tubex-wechatbot"
- name: 安装依赖并启动机器人
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
cd /home/ubuntu/.nvm
source ./nvm.sh
nvm use 21
npm install -g yarn
cd /home/ubuntu/tubex-wechatbot
yarn