Changes #6
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js ⚙️ | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '19' | |
| cache: 'npm' | |
| - name: Install dependencies 📦 | |
| run: npm ci | |
| - name: Build 🔧 | |
| run: NODE_ENV=production npm run build | |
| - name: Create .nojekyll file 📄 | |
| run: touch dist/.nojekyll | |
| # For GitHub User Pages, we need a properly configured root index.html | |
| - name: Prepare dist for GitHub Pages 📄 | |
| run: | | |
| # Copy all images to dist to ensure they're available | |
| mkdir -p dist/images | |
| cp -r public/images/* dist/images/ || true | |
| # Create proper 404.html for GitHub Pages SPA routing | |
| cp dist/index.html dist/404.html | |
| # Create a custom type map file to fix MIME type issues | |
| echo '{ "*.js": "application/javascript", "*.jsx": "application/javascript" }' > dist/typesMap.json | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: dist | |
| branch: gh-pages |