-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.php
55 lines (42 loc) · 1.19 KB
/
deploy.php
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
<?php namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/npm.php';
// Project name
set('application', 'underground.works');
// Project repository
set('repository', 'https://github.com/underground-works/website.git');
// Shared files/dirs between deploys
add('shared_files', [ 'public/clockwork', 'database/database.sqlite' ]);
set('writable_dirs', []);
set('default_stage', 'production');
set('allow_anonymous_stats', false);
set('user', function () {
return runLocally('git config --get user.name');
});
// Hosts
host('arizona')
->set('labels', [ 'stage' => 'development' ])
->set('user', 'its')
->set('deploy_path', '/Sites/its/underground.works');
// Tasks
desc('Execute npm run production');
task('npm:run:production', function () {
run('cd {{release_path}} && {{bin/npm}} run production');
});
/**
* Main deploy task.
*/
desc('Deploys your project');
task('deploy', [
'deploy:prepare',
'deploy:vendors',
'artisan:storage:link',
'artisan:config:cache',
'artisan:route:cache',
'artisan:view:cache',
'npm:install',
'npm:run:production',
'deploy:publish',
]);
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');