Netlify-CRA-Legacy
Description
A project-setup for CI/CD with Create React App (CRA), Github Actions and Netlify using legacy versions of React. Useful if your project includes legacy dependencies.
Usage
-
fork repo
-
import new repo into Netlify and deploy
-
setup Github Actions and Netlify
-
Generate a new personal access token in your Netlify account, labelling it
NETLIFY_AUTH_TOKEN
. At the time of writing this was done by navigating to:- User Settings > Applications > New Access Token
-
Add the
NETLIFY_AUTH_TOKEN
to your GitHub repo- Settings > Secrets
- Important: You must name it
NETLIFY_AUTH_TOKEN
.
-
Return to Netlify and navigate to your deployed site and copy its
Site ID
.- Settings > Site Information > App ID
-
Add the App ID to GitHub with the name of
NETLIFY_SITE_ID
.
-
-
modify
push.yml
to addbranches
orjobs
-
git push
to build, test, (stage, if applicable), deploy
For local development:
-
run
npm i
to install dependencies -
npm start
runs the app in development mode. Open http://localhost:3000
Testing
npm test
launches tests