-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
68 lines (52 loc) · 1.58 KB
/
deploy.php
File metadata and controls
68 lines (52 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/php-fpm.php';
// Config
set('keep_releases', 3);
set('repository', 'git@github.com:tobytwigger/gpsvault');
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('gpsvault.co.uk')
->setSshMultiplexing(true)
->set('remote_user', 'ubuntu')
->set('branch', 'develop')
->set('deploy_path', '/var/www/gpsvault');
// Tasks
task('deploy', [
'deploy:prepare',
'deploy:vendors',
'horizon:publish',
'assets:compile',
'assets:upload',
'artisan:migrate',
'permission:install',
'artisan:storage:link',
'artisan:cache:clear',
'artisan:route:cache',
'artisan:view:cache',
'artisan:config:cache',
'artisan:event:cache',
'artisan:optimize',
'deploy:publish',
]);
task('horizon:publish', artisan('horizon:publish'));
task('permission:install', artisan('permission:install'));
task('meilisearch:install', artisan('meilisearch:install'));
task('assets:compile', function () {
runLocally('npm install');
runLocally('npm run prod');
});
task('assets:upload', function () {
upload('public/dist', '{{release_path}}/public');
upload('public/mix-manifest.json', '{{release_path}}/public');
});
after('deploy:failed', 'deploy:unlock');
// Not currently working, as they don't change their release reference
//after('deploy:success', 'artisan:horizon:terminate');
//after('deploy:success', function() {
// run('php {{release_path}}/artisan websockets:restart');
//});
after('deploy:success', artisan('horizon:terminate'));