Skip to content

Commit 1622c3d

Browse files
authored
Merge pull request #9 from jerseysu/fix-pipeline
ci(playwright.yml): control the pr publish
2 parents cbfddac + 377c9f1 commit 1622c3d

File tree

3 files changed

+39
-27
lines changed

3 files changed

+39
-27
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: publish-pages-build-deployment
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
types:
8+
- closed
9+
10+
jobs:
11+
deployment:
12+
timeout-minutes: 60
13+
if: github.event.pull_request.merged == true
14+
name: "deploy to github"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: deploy to github page
18+
run: npm run deploy

.github/workflows/playwright.yml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: Playwright Tests
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
pull_request:
6-
branches: [ main ]
6+
branches: [main]
7+
78
jobs:
89
tests:
910
timeout-minutes: 60
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14-
with:
15-
node-version: lts/*
16-
- name: Install dependencies
17-
run: npm ci
18-
- name: Install Playwright Browsers
19-
run: npx playwright install --with-deps
20-
- name: Run Playwright tests
21-
run: npx playwright test
22-
- uses: actions/upload-artifact@v4
23-
if: always()
24-
with:
25-
name: playwright-report
26-
path: playwright-report/
27-
retention-days: 30
28-
deployment:
29-
timeout-minutes: 60
30-
if: github.event.pull_request.merged == true
31-
name: 'deploy to github'
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: deploy to github page
35-
run: npm run deploy
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: lts/*
17+
- name: Install dependencies
18+
run: npm ci
19+
- name: Install Playwright Browsers
20+
run: npx playwright install --with-deps
21+
- name: Run Playwright tests
22+
run: npx playwright test
23+
- uses: actions/upload-artifact@v4
24+
if: always()
25+
with:
26+
name: playwright-report
27+
path: playwright-report/
28+
retention-days: 30

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# React Playwright Demo
22
This is the project to demo the playwright with the React App
33

4-
![example workflow](https://github.com/jerseysu/playwright-demo/actions/workflows/playwright.yml/badge.svg)
4+
![testing workflow](https://github.com/jerseysu/playwright-demo/actions/workflows/playwright.yml/badge.svg)
5+
[![pages-build-deployment](https://github.com/jerseysu/react-playwright-demo/actions/workflows/pages/pages-build-deployment/badge.svg?branch=main)](https://github.com/jerseysu/react-playwright-demo/actions/workflows/pages/pages-build-deployment)

0 commit comments

Comments
 (0)