简体   繁体   English

实现 FTP GitHub Action 逐文件上传

[英]Implementing FTP GitHub Action upload file by file

I would like to implement a function with GitHub Actions that will upload to a website any file that is pushed to the repository.我想使用 GitHub Actions 实现一个功能,该功能会将推送到存储库的任何文件上传到网站。 My problem is that on: push is triggered whenever anything changes and it doesn't tell you what actually was pushed, so I'm forced to upload via FTP the entire repository.我的问题是on: push每当发生任何变化时都会触发on: push并且它不会告诉您实际推送了什么,因此我被迫通过 FTP 上传整个存储库。 Is there a way to know which file(s) were pushed?有没有办法知道推送了哪些文件?

name: Deploy file by file via FTP
on: push
jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: push-ftp
      uses: myuser/my-action@releases/v1
      with:
        url: "ftp://ftp.mywebsite.com/"
        files: ${ LIST_OF_FILES } // <-- this is the part I'm missing 
        user: ${{ secrets.FTP_USER }}
        password: ${{ secrets.FTP_PWD }}
git diff --name-only HEAD~

为您提供上次提交中更改的文件列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM