mirror of
https://gitee.com/jack_whh/SFTP-Deploy-Action.git
synced 2026-03-09 23:12:55 +08:00
1. Option to let delete existing files
This commit is contained in:
21
.github/workflows/main.yml
vendored
Normal file
21
.github/workflows/main.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user