Skip to content

Commit

Permalink
fixes yarn/webpacker config for circleci and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sdellis committed Oct 1, 2018
1 parent 9ff3271 commit 92030a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
key: pomegranate-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
keys:
- pomegranate-npm-{{ checksum "package-lock.json" }}
- pomegranate-npm-
- run:
name: NPM install
command: npm install
# Store yarn / webpacker cache
- save_cache:
key: pomegranate-npm-{{ checksum "package-lock.json" }}
paths:
- npm_modules
- run: NODE_ENV=test bundle exec rails webpacker:compile
- persist_to_workspace:
root: '~/pomegranate'
paths: '*'
Expand Down
11 changes: 11 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@
end
end
end

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")
end
end
end
end
after 'deploy:reverted', 'sneakers:restart'
after 'deploy:published', 'sneakers:restart'
after 'deploy:starting', 'sidekiq:quiet'
Expand Down

0 comments on commit 92030a0

Please sign in to comment.