diff --git a/config/deploy.rb b/config/deploy.rb index 29d6a92afa..3d1061aa6a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -64,7 +64,7 @@ task :chrome_install do on roles(:app), wait: 1 do unless Dir.exist?("#{release_path}/.cache/puppeteer/chrome") - execute "cd #{release_path} && npx puppeteer browsers install chrome" + execute "cd #{release_path} && CHROME_PATH=$(npx puppeteer browsers install chrome@stable) && ln -s $(echo $CHROME_PATH | awk '{print $2}') ./bin/chrome" # Add step to clean up old versions and just always run this on each deploy # Check to see if we can peg the version if we need to or at least lock it diff --git a/config/initializers/grover.rb b/config/initializers/grover.rb index b33a03a820..a26c1b069d 100644 --- a/config/initializers/grover.rb +++ b/config/initializers/grover.rb @@ -14,10 +14,6 @@ # - Then rebuild the font index/cache `fc-cache -f -v` # - Verify that both the Roboto and Tinos fonts are installed: `fc-list` # - -dflt_executable_path = Rails.root.join('.cache', 'puppeteer', 'chrome', 'linux-126.0.6478.61', - 'chrome-linux64', 'chrome') - Grover.configure do |config| config.options = { format: 'letter', @@ -35,7 +31,7 @@ # Tell Puppeteer to use headless Chrome headless: true, # Tells Puppeteer where the Chromium executable lives. Update this when Chrome is updated! - executable_path: ENV.fetch('CHROMIUM_PATH', dflt_executable_path), + executable_path: ENV.fetch('CHROMIUM_PATH', Rails.root.join('bin', 'chrome')), launch_args: ['--font-render-hinting=medium', '--no-sandbox', '--disable-setuid-sandbox'], wait_until: 'networkidle0',