1. Option to let delete existing files

This commit is contained in:
wl
2022-06-29 20:47:36 +08:00
parent 8392b571c7
commit 3586e619fa
4 changed files with 47 additions and 43 deletions

21
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Continuous Deploy #action名称
on: [push] #在推送的时候运行此action
jobs:
deploy_job:
runs-on: ubuntu-latest #运行环境
name: sftp
steps:
- name: Checkout
uses: actions/checkout@v2
# 利用action把build好的文件上传到服务器/var/www/react-app路径下,需要确认此目录已在服务端创建
- name: deploy file to server
uses: ./ # Uses an action in the root directory
with:
username: 'root' #ssh user name
server: '${{ secrets.SERVER_IP }}'
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: './action.yml' # 对应我们项目build的文件夹路径
remote_path: '/var/www/react-app/'
delete_remote_files: true