Skip to content

Update index.html and package.json for improved metadata and project … #5

Update index.html and package.json for improved metadata and project …

Update index.html and package.json for improved metadata and project … #5

name: Build and Deploy Hello, React!
on:
push:
branches: [main]
paths:
- 'hello-react/**'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: ./hello-react
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: ./hello-react/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./hello-react/dist
destination_dir: hello-react
keep_files: true # Critical: prevents deleting other apps