Skip to content

Commit

Permalink
增加自动部署的功能
Browse files Browse the repository at this point in the history
增加了自动部署的功能
  • Loading branch information
huabin authored Feb 8, 2024
1 parent 592c967 commit 479df15
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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: Rename directory
run: mv directConfig rules

# 将内容 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 到的目录

0 comments on commit 479df15

Please sign in to comment.