Skip to content

Commit c3550ee

Browse files
committed
fix: install Playwright browsers in sjer.red CI container
The Playwright Docker base image provides system dependencies but not the browser binaries matching the app's Playwright version. Add explicit browser installation with cache volume, matching birmel's pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a3fcb7b commit c3550ee

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.dagger/src/sjer-red.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { Directory, Container, Secret } from "@dagger.io/dagger";
22
import { dag } from "@dagger.io/dagger";
33
import { syncToS3 } from "./lib-s3.ts";
4-
import versions from "./lib-versions.ts";
4+
import versions, { type Versions } from "./lib-versions.ts";
55
import { getBuiltEslintConfig } from "./lib-eslint-config.ts";
66

7+
const PLAYWRIGHT_VERSION: Versions["playwright"] = versions.playwright;
8+
79
function getBunContainer(): Container {
810
return dag
911
.container()
@@ -24,7 +26,12 @@ function getPlaywrightContainer(): Container {
2426
"-c",
2527
`curl -fsSL https://bun.sh/install | bash -s "bun-v${versions.bun}"`,
2628
])
27-
.withEnvVariable("PATH", "/root/.bun/bin:$PATH", { expand: true });
29+
.withEnvVariable("PATH", "/root/.bun/bin:$PATH", { expand: true })
30+
.withMountedCache(
31+
"/root/.cache/ms-playwright",
32+
dag.cacheVolume(`playwright-browsers-sjerred-${PLAYWRIGHT_VERSION}`),
33+
)
34+
.withExec(["bunx", "playwright", "install", "--with-deps", "chromium"]);
2835
}
2936

3037
/**

0 commit comments

Comments
 (0)