forked from sand4rt/ftp-deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (19 loc) · 1.12 KB
/
index.js
File metadata and controls
21 lines (19 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const core = require('@actions/core');
const FtpDeploy = require('ftp-deploy');
core.info('Deploying...');
new FtpDeploy()
.deploy({
sftp: JSON.parse(core.getInput('sftp')) || false,
host: core.getInput('host', { required: true }),
port: JSON.parse(core.getInput('port')) || 21,
user: core.getInput('username', { required: true }),
password: core.getInput('password', { required: true }),
remoteRoot: core.getInput('remote_folder') || './',
localRoot: core.getInput('local_folder') || 'dist', // __dirname + '/local-folder',
deleteRemote: JSON.parse(core.getInput('cleanup')) || false, // If true, delete ALL existing files at destination before uploading
include: JSON.parse(core.getInput('include')) || ['*', '**/*'], // this would upload everything except dot files
exclude: ['node_modules/**', 'node_modules/**/.*', '.git/**'],
forcePasv: JSON.parse(core.getInput('pasive')) || true // Passive mode is forced (EPSV command is not sent)
})
.then(response => core.info('Deploy finished:', response))
.catch(error => core.error(error));