Phần 1: Deploy đầu tiên với Pages Part 1: First deploy with Pages · Bài 1/2 Lesson 1/2

Tạo project Pages từ Git hoặc CLI Create a Pages project from Git or CLI

Kết nối repo GitHub/GitLab hoặc dùng `wrangler pages deploy`. Mỗi PR có preview URL — rất hữu ích cho review. Connect GitHub/GitLab or use `wrangler pages deploy`. Each PR gets a preview URL — great for reviews.

Create a Pages project from Git or CLI
Minh họa từ Cloudflare Reference Architecture (developers.cloudflare.com) Illustration from Cloudflare Reference Architecture (developers.cloudflare.com)

Các bước thực hiện Step-by-step

  1. Dashboard → Workers & Pages → Create → Pages → Connect Git. Dashboard → Workers & Pages → Create → Pages → Connect Git.
  2. Chọn repo, branch production (main), framework preset (Astro/React…). Pick repo, production branch (main), framework preset (Astro/React…).
  3. Deploy lần đầu — kiểm tra URL *.pages.dev. First deploy — verify *.pages.dev URL.
  4. Mở PR test — xác nhận preview deployment URL. Open a test PR — confirm preview deployment URL.

Giải thích chi tiết Detailed explanation

Pages = hosting + CI tích hợp. Preview URL mỗi PR là workflow review không cần staging server riêng. Pages = hosting + built-in CI. Per-PR preview URLs replace separate staging servers for reviews.

Lưu ý (best practices) Note (best practices)

Mỗi Wrangler environment là deployment riêng (`{name}-{env}`). Binding và vars phải khai báo theo từng environment — không kế thừa tự động. Each Wrangler environment is a separate deployment (`{name}-{env}`). Bindings and vars must be declared per environment — they are not inherited automatically.

Nguồn: Source: Workers Best Practices Workers Best Practices

Ví dụ triển khai (Cloudflare Resources) Deployment examples (Cloudflare Resources)

Tutorial, solution guide và reference từ developers.cloudflare.com/resources ↗ — gợi ý theo chủ đề bài học. Tutorials, solution guides, and reference docs from developers.cloudflare.com/resources ↗ — matched to this lesson topic.

Duyệt toàn bộ catalog → Browse full catalog →

Tài liệu Cloudflare Developers Cloudflare Developer docs

Sơ đồ kiến trúc (Cloudflare Docs) Architecture diagrams (Cloudflare Docs)

Figure 1: Cloudflare Developer Platform

Fullstack applications Fullstack applications

Ví dụ fullstack trên Developer Platform — Workers/Pages, storage và AI services trong một kiến trúc thực tế. A practical example of how these services come together in a real fullstack application architecture.

Thuật ngữ: Concepts: Workers · Pages · D1 · R2 · KV · Durable Objects

Sơ đồ chính thức ↗ Official diagram ↗ · Serverless Serverless

Sản phẩm liên quan Related products

Đọc thêm trong hub → Read more in the hub →