Skip to content

Commit c810d9c

Browse files
raifdmuellerclaude
andcommitted
fix: use browser-actions/setup-chrome for Puppeteer in CI
Replaced manual apt-get install with official setup-chrome action. Changes: - Set PUPPETEER_SKIP_DOWNLOAD=true during npm ci (saves time/bandwidth) - Use browser-actions/setup-chrome@latest to install stable Chrome - Set PUPPETEER_EXECUTABLE_PATH env var for prerender script - Updated prerender.js to use executablePath from env if available This avoids package installation failures and uses the GitHub Actions recommended approach for browser testing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a5c6fdd commit c810d9c

2 files changed

Lines changed: 11 additions & 17 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,18 @@ jobs:
2727
node-version: 20
2828
cache: npm
2929

30-
- name: Install Chromium dependencies for Puppeteer
31-
run: |
32-
sudo apt-get update
33-
sudo apt-get install -y \
34-
libnss3 \
35-
libatk1.0-0 \
36-
libatk-bridge2.0-0 \
37-
libcups2 \
38-
libdrm2 \
39-
libxkbcommon0 \
40-
libxcomposite1 \
41-
libxdamage1 \
42-
libxfixes3 \
43-
libxrandr2 \
44-
libgbm1 \
45-
libasound2
46-
4730
- name: Install dependencies
4831
run: npm ci
32+
env:
33+
PUPPETEER_SKIP_DOWNLOAD: true
34+
35+
- name: Setup Chrome for Puppeteer
36+
uses: browser-actions/setup-chrome@latest
37+
with:
38+
chrome-version: stable
39+
40+
- name: Set Puppeteer executable path
41+
run: echo "PUPPETEER_EXECUTABLE_PATH=$(which google-chrome-stable)" >> $GITHUB_ENV
4942

5043
- name: Detect base path
5144
id: base

scripts/prerender.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ async function prerender() {
3333
const browser = await puppeteer.launch({
3434
headless: true,
3535
args: ["--no-sandbox", "--disable-setuid-sandbox"],
36+
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || undefined,
3637
});
3738

3839
const page = await browser.newPage();

0 commit comments

Comments
 (0)