Closed xinyu3ru closed 3 years ago
older code works well
# This is a basic workflow to help you get started with Actions
name: FTP部署
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@master
# Runs a single command using the runners shell
- name: 初始化环境
run: |
sudo apt-get update
sudo apt-get install -y git
sudo apt-get install -y git-ftp
# Runs a set of commands using the runners shell
- name: 开始ftp同步
run: |
#替换你的ip或域名
git config git-ftp.url ${{ secrets.FTP_IP }}
#替换你的ftp账户
git config git-ftp.user ${{ secrets.FTP_USER }}
#替换你的ftp密码
git config git-ftp.password ${{ secrets.FTP_PASSWORD }}
#--disable-epsv可选,因为我的服务器不支持epsv
git ftp push --auto-init -vv --disable-epsv --changed-only -f
#调用宝塔那边的webhook重启python运行环境,让整个项目生效。
- name: 调用webhook
uses: distributhor/workflow-webhook@v1
env:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}
finally, I find the problem in config server needs ftps
protocol: ftps
name: FTP部署
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
web-deploy:
name: 🎉 开始部署
runs-on: ubuntu-latest
steps:
- name: 🚚 获取最新代码
uses: actions/checkout@v2
- name: 📂 同步文件
uses: SamKirkland/FTP-Deploy-Action@4.1.0
with:
server: ${{ secrets.FTP_IP }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./xlsx2vcf/
server-dir: xlsx2vcf/
log-level: verbose
protocol: ftps
#调用宝塔那边的webhook重启python运行环境,让整个项目生效。
- name: 调用webhook
uses: distributhor/workflow-webhook@v1
env:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}```
Bug Description FTP deploy running OK with other test FTP sever,but not work properly with my service server. ftp account and password is right,I can upload files with other software.
log with this My Action Config
My Action Log