Skip to content

Commit

Permalink
ci: fix frontend deployment with nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
andyksaw committed Dec 10, 2024
1 parent 70cdf2f commit 99bf091
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@

// The Laravel recipe doesn't build any frontend assets, so we'll
// need to do it ourselves here

// NVM doesn't play well with deployer
// https://github.com/deployphp/deployer/issues/2535
//
// Must call use_nvm in every run command related to npm so that
// it's sourced in the current run's shell
set('use_nvm', 'source $HOME/.nvm/nvm.sh');

task('deploy:frontend', function () {
run('npm install');
run('npm run build');
run('{{use_nvm}} && cd {{release_path}} && npm ci');
run('{{use_nvm}} && cd {{release_path}} && npm run build');
})->desc('Build frontend assets');

after('deploy:vendors', 'deploy:frontend');

0 comments on commit 99bf091

Please sign in to comment.