-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.01 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
39
40
41
name: deploy directConfig
on:
push:
branches: [ master ] # master 分支上 push 触发部署
jobs:
build:
# 在 ubuntu 上构建
runs-on: ubuntu-latest
steps:
# 拉取代码
- uses: actions/checkout@v2
# 删除 .git 文件夹
- name: Remove .git folder
run: rm -rf directConfig/.git
# 重命名文件夹
- name: List files before renaming
run: ls -l
- name: Rename directory
run: mv directConfig rules
# 列出重命名后的文件夹
- name: List files after renaming
run: ls -l
# 将内容 SCP 到 VPS 服务器
- name: SCP rules
uses: appleboy/scp-action@master
with:
host: ${{ secrets.VPS_IP }} # VPS 的 IP
username: ${{ secrets.VPS_USER }} # VPS 登录用户名
port: ${{ secrets.VPS_PORT }} # VPS 端口
key: ${{ secrets.SSH_KEY }} # 前面创建的私钥
source: "rules" # 要上传的内容
target: ${{ secrets.VPS_PATH }} # SCP 到的目录