code: public function onPageSaved(PageSavedEvent $event)
      {
          $blocks = $event->getApprovedBlocks();
          foreach ($blocks as $blockk) {
              foreach ($blockk as $block) {
                  $this->pageProductionRenderer->renderBlock(json_encode($block));
              }
          }
          $mediaFiles = array_unique($this->pageProductionRenderer->getMediaFiles());
  
          $webDir = $this->configurationHandler->webDir();
          $fs = new Filesystem();
          foreach ($mediaFiles as $mediaFile) {
              $targetMediaFile = str_replace('/backend/', '/production/', $mediaFile);
              $fs->copy($webDir . $mediaFile, $webDir . $targetMediaFile);
          }
      }
docs: Copies the assets from the backend to production
  
  @param \RedKiteCms\EventSystem\Event\Page\PageSavedEvent $event