You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ⚠️ **배포 전 필수: `package.json`의 `name`을 바꾸세요** (`"my-site"` → 실제 Cloudflare Pages 프로젝트 이름), 그리고 `repository.url`의 `YOUR_USERNAME/YOUR_SITE`도 교체하세요. `deploy` 스크립트가 `$npm_package_name`을 Cloudflare Pages 프로젝트 이름으로 사용합니다 — **건너뛰면 CD가 엉뚱한 프로젝트에 배포하거나 실패합니다.** (create-starter는 `name`을 자동으로 설정합니다. `repository.url`은 수동 설정이 필요합니다.)
41
+
> ⚠️ **배포 전 필수:** GitHub Actions 변수 `PROJECT_NAME`을 실제 Cloudflare Pages 프로젝트 이름으로 설정하고, `repository.url`의 `YOUR_USERNAME/YOUR_SITE`를 교체하세요. 로컬에서 `npm run deploy`를 사용할 경우 해당 스크립트가 `$npm_package_name`을 사용하므로 `package.json`의 `name`도 `"my-site"`에서 같은 프로젝트 이름으로 바꾸세요. (create-starter는 패키지 이름을 자동으로 설정합니다. `PROJECT_NAME`과 `repository.url`은 여전히 직접 설정해야 합니다.)
Copy file name to clipboardExpand all lines: README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ cd my-site && npm install && npm run dev
39
39
```
40
40
41
41
> ⚠️ **Before deploying:** set the GitHub Actions variable `PROJECT_NAME` to your Cloudflare Pages project name and update `repository.url` (replace `YOUR_USERNAME/YOUR_SITE`). For local `npm run deploy`, rename `package.json``name` from `"my-site"` to the same project name because that script uses `$npm_package_name`. (create-starter handles the package name automatically; you still need to set `PROJECT_NAME` and `repository.url`.)
42
+
>
43
+
> For local shell deploys, copy `.env.example` to `.env`, fill the values locally, and keep `.env` untracked.
42
44
43
45
## Project Scope
44
46
@@ -47,6 +49,7 @@ cd my-site && npm install && npm run dev
47
49
- Pages Functions example (`functions/api/hello.js`) with `node:test` unit tests.
48
50
- KV-backed counter (`functions/api/visits.js`) — best-effort counter (KV is eventually consistent — no compare-and-swap; may undercount under concurrent traffic; use a Durable Object for exact counts) + NaN recovery.
- Build contract: `npm run build` verifies the static deploy boundary (`src/`, `_headers`, Pages Functions, `wrangler.toml`, and `package.json` deploy/files settings) without adding a bundler.
Copy file name to clipboardExpand all lines: docs/CLOUDFLARE_PAGES_SETUP.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,11 +51,23 @@ Create an environment named `cloudflare`.
51
51
## 6. Deploy
52
52
53
53
1. Set the GitHub Actions variable `PROJECT_NAME` to the Cloudflare Pages project name. For local `npm run deploy`, also rename `package.json``name` to that same value.
54
-
2. Commit and push to `main`
55
-
3. Go to **Actions** tab → **Deploy to Cloudflare Pages** → **Run workflow**
54
+
2. Run the local gates: `npm run lint`, `npm test`, `npm run build`, and `npm audit --audit-level=high`
55
+
3. Commit and push to `main`
56
+
4. Go to **Actions** tab → **Deploy to Cloudflare Pages** → **Run workflow**
56
57
57
58
Your site will be live at `https://PROJECT_NAME.pages.dev`.
58
59
60
+
### Optional local deploy environment
61
+
62
+
For local shell deploys, copy `.env.example` to `.env`, fill the values on your
63
+
machine, and keep `.env` untracked:
64
+
65
+
```bash
66
+
cp .env.example .env
67
+
set -a &&. ./.env &&set +a
68
+
npm run deploy
69
+
```
70
+
59
71
## Custom Domain (Optional)
60
72
61
73
1. In Cloudflare dashboard → **Workers & Pages** → your project → **Custom domains**
0 commit comments