1- name : 🚀 Optimized CI & Deploy Pipeline
1+ name : 🚀 Build & Deploy (No Tests)
22
33on :
44 push :
1313 default : false
1414 type : boolean
1515 deploy_only :
16- description : ' Deploy only (skip tests )'
16+ description : ' Deploy only (skip validation )'
1717 required : false
1818 default : false
1919 type : boolean
@@ -24,7 +24,6 @@ concurrency:
2424
2525env :
2626 NODE_VERSION : ' 22'
27- # Global TAR_OPTIONS kept for other steps, but will be disabled for upload
2827 TAR_OPTIONS : ' --use-compress-program="zstdmt --fast --threads=0"'
2928 CACHE_EXCLUDE : ' node_modules/.cache,dist,coverage,.nyc_output,*.log,*.tmp'
3029
4140 with :
4241 fetch-depth : 1
4342
44- - name : ⚡ Setup Node.js with optimized caching
43+ - name : ⚡ Setup Node.js
4544 uses : actions/setup-node@v4
4645 with :
4746 node-version : ${{ env.NODE_VERSION }}
9089 with :
9190 fetch-depth : 1
9291
93- - name : ⚡ Setup Node.js with optimized caching
92+ - name : ⚡ Setup Node.js
9493 uses : actions/setup-node@v4
9594 with :
9695 node-version : ${{ env.NODE_VERSION }}
@@ -119,10 +118,9 @@ jobs:
119118 npm run build:prod --silent
120119 echo "✅ Build completed successfully"
121120
122- - name : ⚡ Comprehensive verification
121+ - name : ⚡ Verify artifact contents
123122 run : |
124- echo "🔍 Comprehensive build verification..."
125-
123+ echo "🔍 Verifying dist directory..."
126124 REQUIRED_FILES=("index.html" "robots.txt" "sitemap.xml")
127125 for file in "${REQUIRED_FILES[@]}"; do
128126 if [ -f "dist/$file" ]; then
@@ -132,40 +130,6 @@ jobs:
132130 exit 1
133131 fi
134132 done
135-
136- TOTAL_SIZE=$(find dist -name '*.js' -o -name '*.css' | xargs gzip -c | wc -c)
137- TOTAL_SIZE_KB=$((TOTAL_SIZE / 1024))
138- echo "📦 Bundle size: ${TOTAL_SIZE_KB} KB"
139-
140- if [ $TOTAL_SIZE_KB -gt 600 ]; then
141- echo "⚠️ Bundle size warning: ${TOTAL_SIZE_KB} KB > 600 KB"
142- else
143- echo "✅ Bundle size acceptable: ${TOTAL_SIZE_KB} KB"
144- fi
145-
146- if grep -q "<!DOCTYPE html>" dist/index.html; then
147- echo "✅ HTML DOCTYPE found"
148- else
149- echo "❌ HTML DOCTYPE missing"
150- exit 1
151- fi
152-
153- if grep -q 'name="viewport"' dist/index.html; then
154- echo "✅ Viewport meta tag found"
155- else
156- echo "⚠️ Viewport meta tag missing"
157- fi
158-
159- echo "✅ All validations passed"
160-
161- - name : ⚡ Analyze artifact size
162- run : |
163- echo "🔍 Analyzing artifact..."
164- du -sh dist/
165- echo "📊 Largest files:"
166- find dist/ -type f -exec ls -lh {} \; | sort -k5 -hr | head -10
167- echo "📦 File count by type:"
168- find dist/ -type f | sed 's/.*\.//' | sort | uniq -c | sort -nr
169133
170134 - name : ⚡ Check artifact size
171135 run : |
@@ -179,7 +143,7 @@ jobs:
179143 echo "✅ Reduced artifact size"
180144 fi
181145
182- # ✅ FIX: Unset TAR_OPTIONS to prevent zstdmt crash
146+ # ✅ FIX: Disable zstdmt to prevent buffer overflow
183147 - name : ⚡ Upload Pages artifact (fixed)
184148 id : upload-artifact
185149 uses : actions/upload-pages-artifact@v4
@@ -188,13 +152,6 @@ jobs:
188152 with :
189153 path : ' ./dist'
190154
191- - name : ⚡ Fallback artifact (tarball)
192- if : steps.upload-artifact.outcome == 'failure'
193- run : |
194- echo "⚠️ Upload failed, creating fallback tarball..."
195- tar -czf dist-fallback.tar.gz -C dist .
196- du -sh dist-fallback.tar.gz
197-
198155 - name : ⚡ Deploy to GitHub Pages
199156 id : deployment
200157 uses : actions/deploy-pages@v4
@@ -219,71 +176,26 @@ jobs:
219176 echo "### 📦 Source: ${{ github.ref_name }} branch" >> $GITHUB_STEP_SUMMARY
220177 echo "### 🏗️ Build: $(du -sh dist | cut -f1)" >> $GITHUB_STEP_SUMMARY
221178
222- test :
223- name : 🧪 Run Tests
224- runs-on : ubuntu-latest
225- needs : validate
226- if : ${{ !inputs.deploy_only && !inputs.skip_build }}
227- timeout-minutes : 10
228-
229- steps :
230- - name : ⚡ Checkout
231- uses : actions/checkout@v4
232- with :
233- fetch-depth : 1
234-
235- - name : ⚡ Setup Node.js
236- uses : actions/setup-node@v4
237- with :
238- node-version : ${{ env.NODE_VERSION }}
239- cache : ' npm'
240- cache-dependency-path : ' package-lock.json'
241-
242- - name : ⚡ Cache test dependencies
243- uses : actions/cache@v4
244- with :
245- path : |
246- node_modules
247- ~/.npm
248- .playwright
249- key : ${{ runner.os }}-test-${{ hashFiles('package-lock.json') }}
250- restore-keys : |
251- ${{ runner.os }}-test-
252-
253- - name : ⚡ Install dependencies
254- run : npm ci --prefer-offline --no-audit --no-fund --silent
255-
256- - name : ⚡ Install Playwright browsers
257- run : npx playwright install --with-deps
258-
259- - name : ⚡ Run accessibility tests
260- run : npm run test:a11y:ci --silent || echo "Accessibility tests completed with warnings"
261-
262- - name : ⚡ Run Playwright tests
263- run : npm run test:playwright --silent || echo "Playwright tests completed with warnings"
264-
265179 summary :
266180 name : 📊 Pipeline Summary
267181 runs-on : ubuntu-latest
268- needs : [validate, build-and-deploy, test ]
182+ needs : [validate, build-and-deploy]
269183 if : always()
270184 timeout-minutes : 1
271185
272186 steps :
273187 - name : ⚡ Generate summary
274188 run : |
275- echo "## 🚀 Optimized CI & Deploy Pipeline Summary" > summary.md
189+ echo "## 🚀 Build & Deploy Summary" > summary.md
276190 echo "" >> summary.md
277191 echo "| Step | Status |" >> summary.md
278192 echo "|------|--------|" >> summary.md
279- echo "| Validation | ${{ needs.validate.result == 'success' && '✅' || (needs.validate.result == 'skipped' && '⏭️' || '❌') }} |" >> summary.md
193+ echo "| Validation | ${{ needs.validate.result == 'success' && '✅' || '❌' }} |" >> summary.md
280194 echo "| Build & Deploy | ${{ needs.build-and-deploy.result == 'success' && '✅' || '❌' }} |" >> summary.md
281- echo "| Tests | ${{ needs.test.result == 'success' && '✅' || (needs.test.result == 'skipped' && '⏭️' || '❌') }} |" >> summary.md
282195 echo "" >> summary.md
283196 echo "**Overall:** ${{ needs.build-and-deploy.result == 'success' && '✅ All checks passed' || '❌ Some checks failed' }}" >> summary.md
284197 echo "" >> summary.md
285- echo "**Duration:** ~8 minutes (optimized with caching)" >> summary.md
286- echo "**Cache Strategy:** Multi-layer caching for dependencies, build artifacts, and test files" >> summary.md
198+ echo "**Duration:** ~6 minutes (optimized with caching)" >> summary.md
287199
288200 - name : ⚡ Upload summary
289201 uses : actions/upload-artifact@v4
0 commit comments