File tree Expand file tree Collapse file tree 1 file changed +50
-11
lines changed
Expand file tree Collapse file tree 1 file changed +50
-11
lines changed Original file line number Diff line number Diff line change 1- name : CI
1+ name : CI/CD
22
33on :
44 push :
77 branches : [ main, develop ]
88
99jobs :
10- test :
10+ install :
1111 runs-on : ubuntu-latest
1212
13- strategy :
14- matrix :
15- node-version : [24]
16-
1713 steps :
1814 - name : Checkout repository
1915 uses : actions/checkout@v4
2016
21- - name : Setup Node.js ${{ matrix.node-version }}
17+ - name : Setup Node.js 24
2218 uses : actions/setup-node@v4
2319 with :
24- node-version : ${{ matrix.node-version }}
20+ node-version : 24
2521 cache : ' npm'
2622
2723 - name : Install dependencies
2824 run : npm ci
2925
26+ - name : Cache node_modules
27+ uses : actions/cache@v4
28+ with :
29+ path : node_modules
30+ key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
31+
32+ build :
33+ runs-on : ubuntu-latest
34+ needs : install
35+
36+ steps :
37+ - name : Checkout repository
38+ uses : actions/checkout@v4
39+
40+ - name : Setup Node.js 24
41+ uses : actions/setup-node@v4
42+ with :
43+ node-version : 24
44+ cache : ' npm'
45+
46+ - name : Restore node_modules
47+ uses : actions/cache@v4
48+ with :
49+ path : node_modules
50+ key : ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
51+
3052 - name : Build project
3153 run : npm run build
3254
33- - name : Run tests
34- run : npx playwright test
35- if : success() || failure()
55+ - name : Upload build artifacts
56+ uses : actions/upload-artifact@v4
57+ with :
58+ name : build-files
59+ path : dist/
60+
61+ deploy :
62+ runs-on : ubuntu-latest
63+ needs : build
64+ if : github.ref == 'refs/heads/main'
65+
66+ steps :
67+ - name : Download build artifacts
68+ uses : actions/download-artifact@v4
69+ with :
70+ name : build-files
71+ path : dist/
72+
73+ - name : Deploy to production
74+ run : echo "Deploy step - configure with your deployment target"
You can’t perform that action at this time.
0 commit comments