fix: remove invalid eslint-disable comment in AudioPlayer #174
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy React Portfolio | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'front/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: github-pages | |
| defaults: | |
| run: | |
| working-directory: ./front | |
| steps: | |
| - name: Checkout Repository 🛎️ | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js Environment ⚙️ | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 18 | |
| cache: 'npm' | |
| cache-dependency-path: 'front/package-lock.json' | |
| - name: Install Dependencies 📦 | |
| run: npm ci | |
| - name: Optimize Images 🖼️ | |
| run: | | |
| echo "=== Checking for unoptimized images ===" | |
| # Only optimize if there are new images (no .webp versions) | |
| NEW_IMAGES=$(find public/images -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" \) ! -name "*-original.*" ! -name "*-optimized.*" | wc -l) | |
| echo "Found $NEW_IMAGES images to potentially optimize" | |
| if [ $NEW_IMAGES -gt 0 ]; then | |
| # Check if webp versions already exist | |
| WEBP_COUNT=$(find public/images -type f -name "*.webp" | wc -l) | |
| echo "Existing WebP images: $WEBP_COUNT" | |
| if [ $WEBP_COUNT -lt $NEW_IMAGES ]; then | |
| echo "🔄 Optimizing images..." | |
| npm run optimize-images || echo "⚠️ Optimization completed with warnings" | |
| echo "✅ Image optimization complete" | |
| else | |
| echo "✅ Images already optimized, skipping" | |
| fi | |
| else | |
| echo "✅ No new images to optimize" | |
| fi | |
| - name: Verify Blog Source Files 🔍 | |
| run: | | |
| echo "=== Blog Source Directory Structure ===" | |
| ls -la public/blog/ || echo "Blog directory not found" | |
| echo "=== Available Markdown Posts ===" | |
| find public/blog/posts -name "*.md" 2>/dev/null | wc -l | xargs echo "Found markdown files:" | |
| find public/blog/posts -name "*.md" 2>/dev/null || echo "No markdown files found" | |
| - name: Build Application 🔧 | |
| run: npm run build | |
| env: | |
| CI: false | |
| - name: Verify Blog Data Generation 📊 | |
| run: | | |
| echo "=== Generated Blog Data ===" | |
| if [ -f "src/data/blogData.json" ]; then | |
| echo "✅ blogData.json generated successfully" | |
| echo "Posts count: $(cat src/data/blogData.json | grep -o '"slug"' | wc -l)" | |
| echo "Categories: $(cat src/data/blogData.json | grep -o '"category":"[^"]*"' | sort -u)" | |
| else | |
| echo "❌ blogData.json not found" | |
| exit 1 | |
| fi | |
| - name: Verify Build Output 🔍 | |
| run: | | |
| echo "=== Build Directory Structure ===" | |
| ls -la build/ | |
| echo "=== Build Assets ===" | |
| echo "JS files: $(find build/static/js -name "*.js" | wc -l)" | |
| echo "CSS files: $(find build/static/css -name "*.css" | wc -l)" | |
| echo "Total build size: $(du -sh build/ | cut -f1)" | |
| - name: Deploy to GitHub Pages 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: front/build | |
| branch: gh-pages | |
| clean: true | |
| commit-message: 'Deploy portfolio with blog data 🚀' |