diff --git a/config/deploy.rb b/config/deploy.rb index 5a3652b..f001451 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -31,4 +31,6 @@ set :keep_releases, 2 +before 'deploy:assets:precompile', 'deploy:yarn_install' + after 'deploy:migrate', 'seed' diff --git a/lib/capistrano/tasks/yarn.rake b/lib/capistrano/tasks/yarn.rake new file mode 100644 index 0000000..4a8e624 --- /dev/null +++ b/lib/capistrano/tasks/yarn.rake @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +namespace :deploy do + desc 'Run rake yarn install' + task :yarn_install do + on roles(:web) do + within release_path do + execute("cd #{release_path} && yarn install --silent --no-progress --no-audit --no-optional") + end + end + end +end