public override async Task PublishedAsync(PublishContentContext context)
 {
     if (_deploymentOptions.DeployOnPublish)
     {
         try
         {
             await _deploymentService.DeployAsync();
         }
         catch (Exception e)
         {
             _logger.LogError(e, "Couldn't create deployment on PublishedAsync.");
         }
     }
 }
        public async Task <IActionResult> Deploy()
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageDeploymentSettings))
            {
                return(Forbid());
            }

            await _deploymentService.DeployAsync();

            return(RedirectToAction(nameof(Index)));
        }