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