Git and direct deployments

Choose Git integration or Direct Upload

Pick the deployment source before creating the project because switching models later may require a new project.

8 minute lesson

~~~

Git integration watches a GitHub or GitLab repository and creates deployments from pushes. Direct Upload receives prebuilt assets from Wrangler, your own CI, or the dashboard.

The project creation choice matters: current Pages documentation warns that Git-integrated and Direct Upload projects cannot simply switch to the other integration model later. Choose based on who owns builds and release policy.

Write down whether Cloudflare or your CI should build the site, then select the corresponding project type.

Build first, then inspect the directory you plan to upload:

npm run build
find dist -maxdepth 2 -type f | sort | head
npx wrangler pages deploy dist --project-name practice-site

Replace dist with the real output directory. Open the deployment URL and one static asset before attaching a domain. If CI owns the upload, run the same build there and keep the exact commit with the deployment.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →