Project description update #25
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
| # Deploy react-app (Vite) to GitHub Pages for https://eltonchang1.github.io/ | |
| # | |
| # After first push: Repo → Settings → Pages → Build and deployment → Source: GitHub Actions | |
| # (not “Deploy from a branch”). The first run may require approving the workflow. | |
| # | |
| # Action versions below target the Node.js 24 runtime (see GitHub Actions changelog: | |
| # https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ ). | |
| name: Deploy site to Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| cache-dependency-path: react-app/package-lock.json | |
| - name: Install dependencies | |
| working-directory: react-app | |
| run: npm ci | |
| - name: Build | |
| working-directory: react-app | |
| run: npm run build | |
| # GitHub Pages serves 404.html for unknown paths; copy SPA shell for client-side routes later. | |
| - name: SPA fallback for Pages | |
| working-directory: react-app | |
| run: cp dist/index.html dist/404.html | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: react-app/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |