2020-08-26 01:28:40 -05:00
|
|
|
import * as core from "@actions/core";
|
|
|
|
|
import { deploy } from "@samkirkland/ftp-deploy";
|
|
|
|
|
import { IFtpDeployArguments } from "@samkirkland/ftp-deploy/dist/module/types";
|
|
|
|
|
|
|
|
|
|
async function runDeployment() {
|
|
|
|
|
const args: IFtpDeployArguments = {
|
|
|
|
|
server: core.getInput("server", { required: true }),
|
|
|
|
|
username: core.getInput("username", { required: true }),
|
|
|
|
|
password: core.getInput("password", { required: true }),
|
|
|
|
|
protocol: core.getInput("protocol") as any, // todo fix
|
|
|
|
|
port: core.getInput("port") as any, // todo fix
|
|
|
|
|
"local-dir": core.getInput("local-dir") as any, // todo fix
|
|
|
|
|
"server-dir": core.getInput("server-dir") as any, // todo fix
|
|
|
|
|
"state-name": core.getInput("state-name") as any, // todo fix
|
|
|
|
|
"dry-run": core.getInput("dry-run") as any, // todo fix
|
|
|
|
|
"dangerous-clean-slate": core.getInput("dangerous-clean-slate") as any, // todo fix
|
|
|
|
|
"include": core.getInput("include") as any, // todo fix
|
|
|
|
|
"exclude": core.getInput("exclude") as any, // todo fix
|
|
|
|
|
"log-level": core.getInput("log-level") as any // todo fix
|
|
|
|
|
};
|
2020-02-18 00:34:10 -06:00
|
|
|
|
2020-03-30 23:20:38 -05:00
|
|
|
|
|
|
|
|
try {
|
2020-08-26 01:28:40 -05:00
|
|
|
await deploy(args);
|
2020-03-30 23:20:38 -05:00
|
|
|
}
|
|
|
|
|
catch (error) {
|
2020-08-26 01:28:40 -05:00
|
|
|
core.setFailed(error);
|
2020-02-18 00:34:10 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-26 01:28:40 -05:00
|
|
|
runDeployment();
|