-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.09 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
# action的名称
name: ucalendar.cn
# 运行器 的名称
run-name: ucalendar.cn
# 监听指定分支的push和pull_request事件
on:
push:
tags:
- v1.*
jobs:
# 运行的任务 build_deploy
build_deploy:
runs-on: ubuntu-latest # 任务运行在最新的操作平台
strategy:
matrix:
node-version: [ 18.x ] # 通过指定多个版本,从而对多个版本都进行测试
steps:
- uses: actions/checkout@v3 # checkout的妙用 https://github.com/actions/checkout
- uses: actions/setup-node@v3 # 使用 setup-node v3 版本来安装指定的nodejs
with:
node-version: ${{ matrix.node-version }} # 这里可以指定特定版本,也可以引用变量
- run: npm install # 执行命令
- run: npm run build # 执行命令
name: '部署'
- uses: cross-the-world/scp-pipeline@master
with:
host: ${{ secrets.USER_HOST }}
user: ${{ secrets.USER_NAME }}
pass: ${{ secrets.USER_PASS }}
connect_timeout: 20s
local: './dist/*'
remote: /usr/local/nginx/html