Connect GitHub to Cloudflare Pages
Connect Cloudflare Pages to GitHub once. It can then build and publish your website when you push an update.
Have a live pages.dev website built from your GitHub main branch.
Let’s do this
- 1In your browser
Open a free Cloudflare account
Sign in or create an account, then open Workers & Pages. Choose Create application, Pages, then Connect to Git. Dashboard labels can change; follow the linked Pages Git guide. Use this Git-connected route for the course. Direct Upload is a different setup.
Cloudflare Pages: connect GitHub (opens a new tab) - 2In Cloudflare and GitHub
Give access to just this GitHub project
Choose GitHub, sign in and approve the Cloudflare integration for the selected little-garden repository. Choose “Only select repositories” if offered. Back in Cloudflare, choose that repository. You do not need to make its source public.
- 3In Cloudflare
Set the build details for this course
Choose main as the production branch. For the basic React + Vite project, use npm run build and output directory dist. Keep the root at the repository root if package.json is there. Match NODE_VERSION to the supported Node major you used locally. Ask your AI to confirm these settings from your actual files.
Cloudflare Pages: build configuration (opens a new tab)Production branch: main Build command: npm run build Build output directory: dist Root directory: repository root NODE_VERSION: match your local supported major version - 4In Cloudflare
Publish and read the result
Select Save and Deploy. Wait for a successful build and open the address Cloudflare provides, ending in pages.dev. This site is public. A failed build has a log; copy the relevant error to the AI, fix locally, commit and push again.
- 5On your phone and browser
Test outside your Mac
Open the live URL in a private browser window and on your phone using mobile data. Check links, images, the main action and directly opening an inner page. Close your laptop and confirm the public site still loads. Keep the link for the next lesson.
A message for your AI helper
Inspect this project and tell me the exact Cloudflare Pages Git build settings: production branch, build command, public output folder, repository root and compatible Node version. This course uses React with Vite, but use the actual files as evidence. Help me connect only this GitHub repository and publish on the free pages.dev address. Do not enable a paid plan. After deployment, guide me through checking the live site and direct page links.
What you should see
Your pages.dev link works on a phone without your Mac, and Cloudflare shows a successful deployment from the correct GitHub commit.
If you get stuck
Checked 7 September 2026. Screens can change; the official guides below have the latest steps.
Cloudflare Pages: connect GitHubCloudflare Pages: build configurationCloudflare Pages: free plan limitsCloudflare: Next.js on Workers