diff --git a/.github/workflows/issue-40.yml b/.github/workflows/issue-40.yml index 4d6e0fa..e7f43ba 100644 --- a/.github/workflows/issue-40.yml +++ b/.github/workflows/issue-40.yml @@ -22,24 +22,26 @@ jobs: with: fetch-depth: 2 - - name: SFTP uploader - uses: wangyucode/sftp-upload-action@v2.0.3 + - name: SFTP uploader v2.0.4 + uses: wangyucode/sftp-upload-action@v2.0.4 with: host: ${{ secrets.HOST }} port: 22 + username: ${{ secrets.USERNAME }} privateKey: ${{ secrets.SERVER_KEY }} localDir: "." remoteDir: "/tmp/test/" dryRun: false - exclude: "**/.git,**/node_modules" + exclude: ".git,node_modules,not-remove,dist/*,*.json" - - name: SFTP uploader - uses: wangyucode/sftp-upload-action@v2.0.4 + - name: SFTP uploader v2.0.3 + uses: wangyucode/sftp-upload-action@v2.0.3 with: host: ${{ secrets.HOST }} port: 22 + username: ${{ secrets.USERNAME }} privateKey: ${{ secrets.SERVER_KEY }} localDir: "." remoteDir: "/tmp/test/" dryRun: false - exclude: ".git,node_modules,not-remove" + exclude: "**/.git,**/node_modules,**/not-remove,**/dist/*,**/*.json" diff --git a/README.md b/README.md index 448c66a..82fbd50 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ this is a github action script for upload files to server via SFTP protocol. localDir: 'dist', # Required, Absolute or relative to cwd. remoteDir: '/path/to/dest' # Required, Absolute path only. dryRun: false # Optional. Default to false. - exclude: 'node_modules/,**/*.spec.ts' # Optional. exclude patterns (glob) like .gitignore, use ',' to split, Default to ''. + exclude: 'node_modules/,**/*.spec.ts' # Optional. exclude patterns (glob), working on both server-side and client-side like .gitignore, use ',' to split, Default to ''. forceUpload: false # Optional, Force uploading all files, Default to false(upload only newer files). removeExtraFilesOnServer: false # Optional, Remove extra files on server. Default to false. ``` diff --git a/lib/deployer.js b/lib/deployer.js index 5ba4fdb..349ba9e 100644 --- a/lib/deployer.js +++ b/lib/deployer.js @@ -136,7 +136,7 @@ class Deployer { const relativePath = this.getRelativePath(filePath, true); if (this.isIgnoreFile(`${relativePath}${file.type === 'd' ? '/' : ''}`)) { - console.log(`ignoring remote ${relativePath}`); + console.log(`ignored remote ${relativePath}`); continue; }