sand4rt / ftp-deployer Goto Github PK
View Code? Open in Web Editor NEWSimple SFTP / FTP deployment with NodeJS.
Home Page: https://github.com/marketplace/actions/ftp-deployer
License: MIT License
Simple SFTP / FTP deployment with NodeJS.
Home Page: https://github.com/marketplace/actions/ftp-deployer
License: MIT License
on: [push]
jobs:
mirror_with_sftp:
name: deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: ${{ secrets.SERVER_HOST }}
port: 22
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
remote_folder: ${{ secrets.SERVER_PATH }}
local_folder: '.'
cleanup: false
include: '[ "*", "**/*" ]'
exclude: '["src/core/db.php", "node_modules/**", "_secret.php", ".github/**", ".git/**", "*.env"]'
pasive: true
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2, sand4rt/[email protected]
Run sand4rt/[email protected]
(node:3021) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Deploying...
/home/runner/work/_actions/sand4rt/ftp-deployer/v1.1/dist/index.js:11609
return reentry();
^
ReferenceError: reentry is not defined
at /home/runner/work/_actions/sand4rt/ftp-deployer/v1.1/dist/index.js:11609:11
at Socket. (/home/runner/work/_actions/sand4rt/ftp-deployer/v1.1/dist/index.js:11668:7)
at Object.onceWrapper (events.js:300:26)
at Socket.emit (events.js:210:5)
at TCP. (net.js:659:12)
Github is deprecating Node12: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
Can this action to updated to use Node16?
jobs:
build:
name: Production
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12.18.3'
# other stuff
- name: Deploy
uses: sand4rt/[email protected]
with:
host: ************
username: ************
password: ************
local_folder: ************
cleanup: true
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module '@actions/core'
Require stack:
- D:\a\_actions\sand4rt\ftp-deployer\v0.1\index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (D:\a\_actions\sand4rt\ftp-deployer\v0.1\index.js:1:14)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'D:\\a\\_actions\\sand4rt\\ftp-deployer\\v0.1\\index.js' ]
}
Config code:
- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: ${{ secrets.SERVER_HOST }}
port: 22
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
remote_folder: ${{ secrets.SERVER_PATH }}
local_folder: '.'
cleanup: false
include: '[ "*", "**/*" ]'
exclude: '["node_modules/**", ".github/**", ".git/**", "*.env"]'
pasive: true
Error:
[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
I just ran it in my Workflow, it did deploy correctly, but finished with this log
Run sand4rt/[email protected]
Deploying...
(node:3404) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Error: TypeError: core.log is not a function```
The example given in the readme for the include and exclude is incorrect formatting. Should change it to this
include: [] # optional, e.g. '["dist"]'
exclude: [] # optional, e.g. '["node_modules/**", ".git/**", "*.env"]'
(node:1588) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Github requires upgrade of actions to use Node.js 20. Build annotation using this project:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: sand4rt/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
It says in readme:
include: '' # optional, e.g.
# - dist
exclude: '' # optional
# - node_modules/**
# - node_modules/**/.*
# - .git/**
# - *.env
seems that I need to provide a yaml raw list, but actually:
index.js
include: JSON.parse(core.getInput('include')) || ['*', '**/*'], // this would upload everything except dot files
exclude: JSON.parse(core.getInput('exclude')) || ['node_modules/**', 'node_modules/**/.*', '.git/**'], // e.g. exclude sourcemaps, and ALL files in node_modules (including dot files)
It parses a json array string.
I think no one will understand how to deploy this action until he or she read index.js
Hi
i try to upload my webpage but the .htaccess file do not want to upload. Any idea why? is it because of the . in the beginning?
Thanks for your help.
KR
Nischi
After trying a while, I figured out, it must be
exclude: '["node_modules/", ".git/", "*.env"]'
The whole array must be in a string and all values must be in double ".
Also I get this warning:
(node:2932) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
I really appreciate, the effort you put into this.
in github actions i get error:
Run sand4rt/[email protected] Deploying... (node:1656) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Err dist/ is not an existing location Error: Error: dist/ is not an existing location
here is snippet for YAML
jobs: FTP-Deploy-Action: name: FTP-Deploy-Action runs-on: ubuntu-latest steps: - uses: actions/[email protected] with: fetch-depth: 2 - name: FTP Deployer uses: sand4rt/[email protected] with: sftp: false # optional host: ${{ secrets.CF_FTP_SERVER }} # e.g. ftp.host.com or sftp.host.com (without ftp:// or ftps://) port: 21 # optional, default is: 21 username: ${{ secrets.CF_FTP_USER_NAME }} # FTP username password: ${{ secrets.CF_FTP_USER_PASS }} # FTP password remote_folder: "demo/" # optional, remote path of your FTP server local_folder: "dist/" # optional, local path, default is: dist cleanup: false # optional, remove existing files inside FTP remote folder exclude: '["node_modules/**",".git/**","*.env,img/**","images/**","Backups/**","logs/**","ups2csv/**","Witango5Admin/**","CFSITEMAP-ALPHA_files/**","CFSITEMAP_files/**","aspnet_client/**"]' passive: true
please note I have tried
- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER _PASSWORD }}
remote_folder: '/home/maxbase/public_html/test/'
local_folder: 'build/'
cleanup: false
include: '[ "*", "**/*" ]'
exclude: '["node_modules/**", ".github/**", ".git/**", "*.env"]'
Warning: Unexpected input(s) 'pasive', valid inputs are ['sftp', 'host', 'port', 'username', 'password', 'remote_folder', 'local_folder', 'cleanup', 'include', 'exclude', 'passive']
It seems "pasive" not supported in version 1.5 but it supported in version 1.4
The following job works:
- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: asrez.com
port: 22
username: username
password: ${{ secrets.FTP_PASSWORD }}
remote_folder: '/home/maxbase/public_html/test-react/'
local_folder: 'build/'
cleanup: false
include: '[ "*", "**/*" ]'
exclude: '["node_modules/**", "_secret.php", ".github/**", ".git/**", "*.env"]'
pasive: true
But when you change version from 1.4 to 1.5, It not works (Also we must remove pasive):
- name: FTP Deployer
uses: sand4rt/[email protected]
with:
sftp: true
host: asrez.com
port: 22
username: username
password: ${{ secrets.FTP_PASSWORD }}
remote_folder: '/home/maxbase/public_html/test-react/'
local_folder: 'build/'
cleanup: false
include: '[ "*", "**/*" ]'
exclude: '["node_modules/**", "_secret.php", ".github/**", ".git/**", "*.env"]'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.