This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Ensure you update the following items to customize the project:
- Favicon: Update the
<link rel="icon">inindex.htmland replace the logo insrc/assets/. - Project Title: Update the
<title>tag inindex.html. - Package Info: Update
name,version, anddescriptioninpackage.json. - GitHub Secrets: Configure your secretsin your GitHub repository:
- All
VITE_*environment variables required by your application. - Update them in
.github/workflows/deploy.ymlso they are also built into the deployed site
- All
- name: Build site
env:
VITE_AWS_REGION: ${{ secrets.VITE_AWS_REGION }}
...
VITE_APP_URL: ${{ secrets.VITE_APP_URL }}
VITE_YOUR_ENV_VARIABLE: ${{ secrets.YOUR_ENV_VARIABLE }}This template includes two GitHub Actions workflows:
-
Build (
build.yml): Triggered on every push and pull request to themainbranch. It ensures the code is clean and buildable by running:- Dependency installation (
npm ci) - Linting (
npm run lint) - Formatting checks (
npm run format:check) - Production build (
npm run build)
- Dependency installation (
-
Deploy (
deploy.yml): Triggered on every push to themainbranch. It automates the deployment to AWS by:- Building the production application with the necessary environment variables.
- Authenticating with AWS using OIDC.
- Synchronizing the build output (
dist/) to an S3 bucket. - Invalidating the CloudFront distribution to ensure the latest version is served.
Available package.json scripts:
npm run dev: Start the Vite dev server with HMR.npm run build: Type-check with TypeScript project references and build for production.npm run lint: Run ESLint across the codebase.npm run format:check: Check formatting with Prettier without writing changes.npm run format:fix: Format files with Prettier and write changes.npm run preview: Preview the production build locally.