Skip to content

Commit

Permalink
🚀 Update deploy.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelien committed Nov 26, 2022
1 parent a4bdc36 commit 3ba9c95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ Check [Symfony deployment documentation](https://symfony.com/doc/current/deploym

```cmd
vendor/bin/dep deploy --branch=2.x welcome.osm.be
npm run build
rsync -e ssh -avz public/build/ [email protected]:/var/www/osm-welcome-tool/current/public/build/
```

### Automated update
Expand Down
13 changes: 12 additions & 1 deletion deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@
->set('remote_user', 'root')
->set('deploy_path', '/var/www/osm-welcome-tool');

// Tasks

task('npm:build', function () {
runLocally('npm install');
runLocally('npm run build');
});
task('npm:rsync', function () {
runLocally('rsync -e ssh -az public/build/ {{remote_user}}@{{hostname}}:{{release_path}}/public/build/');
});
task('npm', ['npm:build', 'npm:rsync']);

// Hooks

after('deploy:update_code', 'npm');
after('deploy:failed', 'deploy:unlock');

after('deploy:success', 'php-fpm:reload');

0 comments on commit 3ba9c95

Please sign in to comment.