Setup React project

npm create vite@latest project_name -- --template react
cd project_name
npm install
npm run dev

Setup Firebase

npm install firebase-tools
firebase login
firebase init hosting

Configuration

Firebase

? Please select an option: Use an existing project (or create new)
? Select a default Firebase project: [Choose your project]
? What do you want to use as your public directory? dist  `← Important!`
? Configure as a single-page app (rewrite all urls to /index.html)? Yes  `← Important for React Router!`
? Set up automatic builds and deploys with GitHub? Yes
? File build/index.html already exists. Overwrite? No

Github

? For which GitHub repository would you like to set up a GitHub workflow? [username/repo]
? Set up the workflow to run a build script before every deploy? Yes  `← Important!`
? What script should be run before every deploy? npm ci && npm run build
? Set up automatic deployment to your site\\'s live channel when a PR is merged? Yes
? What is the name of the GitHub branch associated with your site's live channel? main

Check if secret was added to Github (Github repo → Settings → Secrets)

Setup and Connect to Github repository