From d70e50dd8f1416a3c6d66bff89314e79a75898dc Mon Sep 17 00:00:00 2001 From: Tim Van Dijck Date: Thu, 21 Mar 2024 14:51:52 +0100 Subject: [PATCH] Add update satis action to Filament. --- app/Filament/Resources/Content/RepositoryResource.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Filament/Resources/Content/RepositoryResource.php b/app/Filament/Resources/Content/RepositoryResource.php index f47a63d1..f8c68c29 100644 --- a/app/Filament/Resources/Content/RepositoryResource.php +++ b/app/Filament/Resources/Content/RepositoryResource.php @@ -15,6 +15,7 @@ use Filament\Tables; use Filament\Tables\Table; use Illuminate\Support\Facades\Artisan; +use Spatie\Ssh\Ssh; class RepositoryResource extends Resource { @@ -83,6 +84,16 @@ function (Repository $record) { fn () => Artisan::call(ImportGitHubRepositoriesCommand::class) )), + Tables\Actions\Action::make('Update Satis') + ->button() + ->requiresConfirmation() + ->icon('heroicon-o-arrow-path') + ->action(fn () => dispatch(function () { + Ssh::create('forge', 'satis.spatie.be')->execute([ + 'cd satis.spatie.be', + './bin/satis build', + ]); + })), ]); }