-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (51 loc) · 1.51 KB
/
Copy pathpr.yml
File metadata and controls
63 lines (51 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: PR
on:
workflow_dispatch: null
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
- name: Checkout repository
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Check formatting
run: bun run check-format
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
- name: Checkout repository
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Install Puppeteer and serve
run: bun install puppeteer serve
- name: Build and export
run: bun run build
- name: Start static server and take screenshots
id: screenshots
run: |
# Start the server in the background
npx serve out -p 3000 &
# Wait longer for server to start
sleep 10
# Take screenshots
bun .github/scripts/take-screenshots.js
# Kill the server
kill $(lsof -t -i:3000)
echo "screenshot_path=screenshots" >> $GITHUB_OUTPUT
- name: Upload screenshots as artifacts
uses: actions/upload-artifact@v4
with:
name: preview-screenshots
path: screenshots/