diff --git a/src/DeployTrait.php b/src/DeployTrait.php index 53a993a..89d66d3 100644 --- a/src/DeployTrait.php +++ b/src/DeployTrait.php @@ -47,6 +47,8 @@ public function deploy($environment, $gitRevision, $options = ['ignore-assets' = $this->taskDeleteDir($buildDirectory)->run(); + // Run webhooks + if ($deployed) { $site_url = $config['WEB_SCHEME'] . '://' . $config['WEB_DOMAIN'] . $config['WEB_PATH']; @@ -72,6 +74,15 @@ public function deploy($environment, $gitRevision, $options = ['ignore-assets' = if ($this->io()->confirm('Clear wp-cubi transient cache ?', true)) { $this->sendWebhookHttpRequest($site_url, 'clear-wp-cubi-transient-cache'); } + + // Ping home url to generate new cache + + $cmd = new Command('curl'); + $cmd = $cmd->arg($site_url) + ->getCommand(); + + $this->taskExec($cmd) + ->run(); } return $deployed;