Update main.yml #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy directConfig | |
on: | |
push: | |
branches: [ master ] # master 分支上 push 触发部署 | |
jobs: | |
build: | |
# 在 ubuntu 上构建 | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取代码 | |
- uses: actions/checkout@v2 | |
# 检查当前目录的文件 | |
- name: Check the folder | |
run: ls -a | |
# 删除 .git 和 .github 文件夹 | |
- name: Remove .git and .github folder | |
run: rm -rf .git .github | |
# 检查当前目录的文件 | |
- name: List files before renaming | |
run: ls -a | |
# 创建 rules 文件夹,并将内容复制到里面 | |
- name: Create rules folder and move all files into it | |
run: mkdir rules && mv *.list rules/ | |
# 检查当前目录的文件 | |
- name: List files before renaming | |
run: ls -a | |
# 将内容 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 到的目录 |