Add deploy

This commit is contained in:
Maarten 2024-11-26 08:42:01 +01:00
parent 0ae60feab5
commit 9aae3144fe
3 changed files with 108 additions and 2 deletions

51
deploy.php Normal file
View file

@ -0,0 +1,51 @@
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'Bit');
// Config
set('repository', 'git@git.maartenvr98.nl:maartenvr98/IPcalc-u-later.git');
set('git_tty', true);
set('keep_releases', 5);
set('writable_mode', 'chmod');
add('shared_files', ['.env']);
add('shared_dirs', []);
add('writable_dirs', []);
// PHP
set('bin/php', function () {
return '/usr/bin/php8.3';
});
// Hosts
host('bit.maartenvr98.nl')
->set('remote_user', 'maartenvr98-bit')
->set('deploy_path', '/home/maartenvr98-bit/htdocs/bit.maartenvr98.nl')
->set('branch', 'main');
// Tasks
task('assets:build', function () {
runLocally('yarn install && yarn build');
});
task('assets:upload', function () {
upload('public/dist', '{{release_path}}/public');
});
// Main deploy task
desc('Deploy your project');
task('deploy', [
'deploy:prepare',
'deploy:vendors',
'assets:build',
'assets:upload',
'deploy:publish',
]);
// Hooks
after('deploy:failed', 'deploy:unlock');