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