site = $site; } protected function progress(int $percentage): void { $this->site->progress = $percentage; $this->site->save(); } /** * @throws FailedToDeployGitKey */ protected function deployKey(): void { $os = $this->site->server->os(); $os->generateSSHKey($this->site->getSshKeyName()); $this->site->ssh_key = $os->readSSHKey($this->site->getSshKeyName()); $this->site->save(); $this->site->sourceControl?->provider()?->deployKey( $this->site->domain.'-key-'.$this->site->id, $this->site->repository, $this->site->ssh_key ); } }