Skip to content

Commit 3752219

Browse files
committed
add: gh action
1 parent 11eb6f2 commit 3752219

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build on PR Merge
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Install TypeScript
27+
run: npm install -g typescript
28+
29+
- name: Run build script
30+
run: npm run build
31+
32+
- name: Verify build output
33+
run: |
34+
if [ ! -f "dist/index.js" ]; then
35+
echo "Build failed - dist/index.js not found"
36+
exit 1
37+
fi
38+
echo "Build successful - dist/index.js created"
39+
40+
- name: Upload build artifacts
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: dist
44+
path: dist/
45+
retention-days: 30

0 commit comments

Comments
 (0)