This is a React-based learning resource for React fundamentals, deployed automatically to GitHub Pages using GitHub Actions.
- Built with React and Tailwind CSS for modern web development learning
- Hosted on GitHub Pages: https://abshetty.in/react-basics/
- Fully automated deployment on every push to the
main
branch via GitHub Actions (workflow file is already included in this repo at.github/workflows/deploy.yml
)
git clone https://github.com/ab007shetty/react-basics.git && cd react-basics
npm install
npm run dev
The application will be available at http://localhost:5173
If you want to recreate this project from scratch, follow these steps:
# Create a new Vite project with React template
npm create vite@latest react-basics -- --template react
cd react-basics
npm install
# Install Tailwind CSS and its dependencies
npm install -D tailwindcss postcss autoprefixer
# Generate Tailwind config files
npx tailwindcss init -p
- Make sure the
"homepage"
field inpackage.json
is set as follows (adjust for your repo):
"homepage": "https://ab007shetty.github.io/react-basics/"
- The
dist/
folder is included in.gitignore
since it is generated automatically.
If you want to deploy manually instead of relying on GitHub Actions, run:
npm run deploy
This builds the app and pushes the dist/
folder to the gh-pages
branch on GitHub.
- The workflow file
.github/workflows/deploy.yml
is already included in this repo. - On every push to the
main
branch, GitHub Actions:- Installs dependencies
- Runs the build script
- Deploys the site to GitHub Pages by pushing the
dist/
folder to thegh-pages
branch
- This means no manual deploy commands needed after setup—just push your code!
Make sure GitHub Pages is configured correctly in your repo:
- Go to Settings > Pages.
- Set Source to:
- Branch:
gh-pages
- Folder:
/ (root)
- Branch:
- Save changes.
Your site will then be live at:
https://<your-github-username>.github.io/<repo-name>/
This project is licensed under the MIT License - see the LICENSE file for details.