wlixcc/SFTP-Deploy-Action

能否弄一个排除文件夹参数

liushuai05 opened this issue · 1 comments

大佬,能否弄一个排除文件夹参数呢,我们这边项目文件都比较多,想通过ci编译后只传编译后的文件到服务器上,不传源码这样

The feature for excluding specific files and directories during deployment has been successfully implemented in version v1.2.5. 🎉

How to use rsyncArgs for excluding files:

You can now use the rsyncArgs input to specify exclusion patterns. Here's an example:

- name: Deploy with rsync exclude
  uses: wlixcc/SFTP-Deploy-Action@v1.2.5
  with:
    username: 'root'
    server: 'your.server.ip'
    ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
    local_path: './'
    remote_path: '/var/www/app'
    rsyncArgs: '--exclude=node_modules --exclude=.git --exclude=*.log'
    sftpArgs: '-o ConnectTimeout=5'

📚 Explanation:
--exclude=node_modules excludes the node_modules folder.
--exclude=.git excludes the .git folder.
--exclude=*.log excludes all .log files.
For more advanced usage, you can see rsync documentation