Assuming you already have created a vite + react-js project.
Open cloudflare dashboard and login to you account. Cloudflare, go to Compute > Workers & Pages and then click Create application you'll see something similar to this:
Select Looking to deploy pages? Get started
Click on the Get started next to Import an existing Git repository option:
Select your github repository where your vite + reactjs project is, and click on Begin Setup:
Select the branch on which anytime you commit and push the code to cloudflare will automatically run your build and deploy command (basically taking care of the CI/CD for your react project). As the project is vite + reactjs project so the run command and output directory by default will be as it is shown in the image below.
You can add .env variables at this stage as well if you have any. The arrow is point to that in the image, but it is optional and you can always add/edit them later.
Click on Save & Deploy to continue.
Once deployed you can check out the URL it has given. Now anytime you push code to the branch you select it'll deploy the app automatically.





Top comments (0)