@@ -3,27 +3,63 @@ name: Integration
3
3
4
4
on :
5
5
push :
6
- branches : [ "main" ]
6
+ branches :
7
+ - main # or your default branch
7
8
pull_request :
8
- branches : [ "main" ]
9
+ branches :
10
+ - main
9
11
10
12
jobs :
11
13
build :
12
-
13
14
runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ # Step 1: Checkout code
18
+ - name : Checkout code
19
+ uses : actions/checkout@v2
14
20
15
- strategy :
16
- matrix :
17
- node-version : [18.x, 20.x, 22.x]
18
- # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
+ # Step 2: Set up the environment
22
+ - name : Set up Node.js
23
+ uses : actions/setup-node@v2
24
+ with :
25
+ node-version : ' 20' # specify your Node.js version
19
26
20
- steps :
21
- - uses : actions/checkout@v4
22
- - name : Use Node.js ${{ matrix.node-version }}
23
- uses : actions/setup-node@v4
24
- with :
25
- node-version : ${{ matrix.node-version }}
26
- cache : ' npm'
27
- - run : npm ci
28
- - run : npm run build
29
- - run : npm test
27
+ # Step 3: Install dependencies
28
+ - name : Install dependencies
29
+ run : npm i
30
+ # step 4 Build
31
+ - name : Run build
32
+ run : npm build
33
+ - name : Run Test
34
+ run : npm run test
35
+
36
+ # deploy:
37
+ # runs-on: ubuntu-latest
38
+ # needs: build # ensures the deploy job runs after the build job
39
+ # steps:
40
+ # # Step 1: Checkout code
41
+ # - name: Checkout code
42
+ # uses: actions/checkout@v2
43
+
44
+ # # Step 2: Set up Node.js (again for deployment environment)
45
+ # - name: Set up Node.js
46
+ # uses: actions/setup-node@v2
47
+ # with:
48
+ # node-version: '14'
49
+
50
+ # # Step 3: Install dependencies (again in the deployment environment)
51
+ # - name: Install dependencies
52
+ # run: npm install
53
+
54
+ # # Step 4: Deploy to the server via SSH
55
+ # - name: Deploy to Server
56
+ # run: |
57
+ # ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} << 'EOF'
58
+ # cd /path/to/your/project
59
+ # git pull origin main
60
+ # npm install
61
+ # npm run build # if you have a build step, otherwise skip
62
+ # pm2 restart all # or your preferred process manager
63
+ # EOF
64
+ # env:
65
+ # SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
0 commit comments