Skip to content

Commit

Permalink
Test Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Jan 10, 2024
1 parent 8a8efcf commit 684bffc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: textbook/take-action@nodejs
with:
node-version: 20
- run: npx playwright install --with-deps
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
load: true
push: false
tags: textbook/starter-kit:v2
- run: |
docker run --detach --init --publish 80:4321 textbook/starter-kit:v2
- run: npm run e2e
env:
PLAYWRIGHT_BASE_URL: http://localhost:4321
4 changes: 2 additions & 2 deletions e2e/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000",
baseURL: process.env.PLAYWRIGHT_BASE_URL ?? "http://localhost:3000",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
Expand Down Expand Up @@ -66,7 +66,7 @@ export default defineConfig({
],

/* Run your local dev server before starting the tests */
webServer: {
webServer: process.env.PLAYWRIGHT_BASE_URL ? false : {
command: "npm run serve",
cwd: join(__dirname, ".."),
url: "http://127.0.0.1:3000",
Expand Down

0 comments on commit 684bffc

Please sign in to comment.