-
Notifications
You must be signed in to change notification settings - Fork 2
29 lines (29 loc) · 1.12 KB
/
ci.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
name: Mondo News action # 名称
on:
push:
branches:
- master # 只在 master 上 push 操作触发部署
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- README.md
jobs:
build-and-deploy:
runs-on: ubuntu-latest # 使用 ubuntu 系统镜像运行自动化脚本
steps: # 自动化步骤
- name: Checkout # 步骤名称
uses: actions/checkout@master # 使用别人包装好的步骤镜像
- name: Deploy file to Server
uses: wlixcc/[email protected]
with:
username: ${{ secrets.USERNAME }} # 引用配置,用户名称
server: ${{ secrets.SERVER_IP }} # 引用配置,服务器 IP
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # 引用配置,SSH 私钥
local_path: './*'
remote_path: '/front/news'
- name: Server Start
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: sh /front/news/deploy.sh # 执行脚本命令