2020-01-20 05:16:28 +08:00
|
|
|
import { setFailed } from "@actions/core";
|
2019-11-19 23:06:27 +08:00
|
|
|
import { init, deploy } from "./git";
|
|
|
|
|
|
|
|
/** Initializes and runs the action. */
|
2020-02-16 03:15:43 +08:00
|
|
|
export default async function main(): Promise<void> {
|
2019-11-19 23:06:27 +08:00
|
|
|
try {
|
|
|
|
await init();
|
|
|
|
await deploy();
|
|
|
|
} catch (error) {
|
2020-01-20 05:16:28 +08:00
|
|
|
/* istanbul ignore next */
|
2019-12-22 03:58:59 +08:00
|
|
|
console.log("The deployment encountered an error. ❌");
|
2020-01-20 05:16:28 +08:00
|
|
|
/* istanbul ignore next */
|
|
|
|
setFailed(error);
|
2019-11-19 23:06:27 +08:00
|
|
|
} finally {
|
2019-12-22 03:58:59 +08:00
|
|
|
console.log("Completed Deployment ✅");
|
2019-11-19 23:06:27 +08:00
|
|
|
}
|
2020-01-20 05:16:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Init
|
|
|
|
main();
|