2121env :
2222 REGISTRY : ghcr.io
2323 IMAGE_NAME : ${{ github.repository }}
24+ NODE_VERSION : 22
25+ PNPM_VERSION : 10.13.1
2426
2527jobs :
2628 # Phase 1: Build and Test
@@ -29,26 +31,22 @@ jobs:
2931 runs-on : ubuntu-latest
3032 outputs :
3133 cache-key : ${{ steps.cache-key.outputs.key }}
32-
33- strategy :
34- matrix :
35- node-version : [ 20, 22 ]
36-
34+
3735 steps :
3836 - name : Checkout code
3937 uses : actions/checkout@v4
4038 with :
4139 fetch-depth : 0
4240
43- - name : Setup Node.js ${{ matrix.node-version }}
41+ - name : Setup Node.js ${{ env.NODE_VERSION }}
4442 uses : actions/setup-node@v4
4543 with :
46- node-version : ${{ matrix.node-version }}
44+ node-version : ${{ env.NODE_VERSION }}
4745
4846 - name : Setup pnpm
4947 uses : pnpm/action-setup@v4
5048 with :
51- version : 10.13.1
49+ version : ${{ env.PNPM_VERSION }}
5250 run_install : false
5351
5452 - name : Generate cache key
6866 - name : Install dependencies
6967 run : ./.github/scripts/setup-node.sh
7068
71- - name : Build packages (dependency order)
69+ - name : Build packages
7270 run : ./.github/scripts/build-packages.sh
7371
7472 - name : Run tests
@@ -145,34 +143,6 @@ jobs:
145143 IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
146144 ./.github/scripts/test-docker.sh "$IMAGE_TAG"
147145
148- # Phase 3: Security Scan (depends on docker-build)
149- security-scan :
150- name : Security Scan
151- runs-on : ubuntu-latest
152- needs : docker-build
153- if : github.event_name != 'pull_request'
154- permissions :
155- contents : read
156- packages : read
157- security-events : write
158-
159- steps :
160- - name : Checkout code
161- uses : actions/checkout@v4
162-
163- - name : Run Trivy vulnerability scanner
164- uses : aquasecurity/trivy-action@master
165- with :
166- image-ref : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
167- format : ' sarif'
168- output : ' trivy-results.sarif'
169-
170- - name : Upload Trivy scan results to GitHub Security tab
171- uses : github/codeql-action/upload-sarif@v3
172- if : always()
173- with :
174- sarif_file : ' trivy-results.sarif'
175-
176146 # Phase 4a: NPM Publish Stable (main branch)
177147 npm-publish-stable :
178148 name : Publish to NPM (Stable)
@@ -196,13 +166,13 @@ jobs:
196166 - name : Setup Node.js
197167 uses : actions/setup-node@v4
198168 with :
199- node-version : ' 20 '
169+ node-version : ${{ env.NODE_VERSION }}
200170 registry-url : ' https://registry.npmjs.org'
201171
202172 - name : Setup pnpm
203173 uses : pnpm/action-setup@v4
204174 with :
205- version : 10.13.1
175+ version : ${{ env.PNPM_VERSION }}
206176 run_install : false
207177
208178 - name : Restore pnpm cache
@@ -280,13 +250,13 @@ jobs:
280250 - name : Setup Node.js
281251 uses : actions/setup-node@v4
282252 with :
283- node-version : ' 20 '
253+ node-version : ${{ env.NODE_VERSION }}
284254 registry-url : ' https://registry.npmjs.org'
285255
286256 - name : Setup pnpm
287257 uses : pnpm/action-setup@v4
288258 with :
289- version : 10.13.1
259+ version : ${{ env.PNPM_VERSION }}
290260 run_install : false
291261
292262 - name : Restore pnpm cache
0 commit comments