async function main()

in src/main.ts [28:65]


async function main(): Promise<void> {
    const actionManager = new Orchestrator();
    actionManager.register(StateConstant.Initialize, new Initializer());
    actionManager.register(StateConstant.ValidateParameter, new ParameterValidator());
    actionManager.register(StateConstant.ValidateAzureResource, new ResourceValidator());
    actionManager.register(StateConstant.PreparePublishContent, new ContentPreparer());
    actionManager.register(StateConstant.PublishContent, new ContentPublisher());
    actionManager.register(StateConstant.ValidatePublishedContent, new PublishValidator());

    while (!actionManager.isDone) {
        try {
            await actionManager.execute();
        } catch (expt) {
            if (expt instanceof BaseException) {
                expt.PrintTraceback(Logger.Error);
            } else if (expt instanceof Error) {
                Logger.Error(expt.message);
                if (expt.stack) {
                    Logger.Error(expt.stack);
                }
            }
            break;
        }
    }

    switch (actionManager.state) {
        case StateConstant.Succeeded:
            core.debug("Deployment Succeeded!");
            return
        case StateConstant.Failed:
            core.setFailed("Deployment Failed!");
            return
        default:
            const expt = new UnexpectedExitException(actionManager.state);
            core.setFailed(expt.message);
            throw expt;
    }
}