Skip to content

Commit

Permalink
combine docker image and test
Browse files Browse the repository at this point in the history
  • Loading branch information
markbeep committed Jul 24, 2024
1 parent d4a0347 commit 9e76d32
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 49 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name: Build and Deploy Dockerfile

on:
workflow_run:
workflows: ["Playwright Tests"]
push:
branches: [main]
types:
- completed

env:
DOCKER_TAG: ${{ secrets.DOCKER_HUB_USERNAME }}/htmx-blog:latest

jobs:
website:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -24,7 +20,21 @@ jobs:
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build Docker image using Nix
run: nix build ".#docker"


# Test playwright
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/playwright.yml

This file was deleted.

2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: process.env.CI
? {
command: "./htmx-blog",
command: "docker run -p 3000:3000 $IMAGE_TAG",
url: "http://127.0.0.1:3000",
reuseExistingServer: !process.env.CI,
}
Expand Down

0 comments on commit 9e76d32

Please sign in to comment.