Skip to content

Commit c1aba14

Browse files
authored
Create github_build.yml
1 parent e6de3aa commit c1aba14

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/github_build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build TypeScript Project
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 18 # نسخه Node.js را بر اساس پروژه تنظیم کنید
24+
cache: 'npm'
25+
26+
- name: Install Dependencies
27+
run: npm install
28+
29+
- name: Build Project
30+
run: npm run build
31+
32+
- name: Start Application on Port 9000
33+
run: |
34+
npm start &
35+
sleep 5
36+
curl -I http://localhost:9000 || echo "Server did not start!"
37+
38+
- name: Archive Build Artifacts
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: build-output
42+
path: dist/

0 commit comments

Comments
 (0)