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
Copy file name to clipboardExpand all lines: .github/workflows/README.md
+14-23Lines changed: 14 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
# CI workflows
2
2
3
-
Two workflows manage Cloudflare Workers deployments for this storefront:
3
+
Cloudflare Workers deployments for this storefront:
4
4
5
-
-**`preview.yml`** — uploads a versioned preview on every PR (and on pushes to `env/**`)
6
-
-**`deploy.yml`** — deploys to production on every push to `main`
5
+
-**Per-PR previews** — handled by the Cloudflare **Workers Builds** GitHub App
6
+
(connected on the Cloudflare side). It builds each PR and posts a sticky
7
+
comment with the Commit/Branch preview URLs. No workflow file is needed.
8
+
-**`deploy.yml`** — deploys to production on every push to `main`.
7
9
8
10
## Required secrets
9
11
@@ -16,28 +18,17 @@ Both workflows need the following GitHub secrets (Settings → Secrets and varia
16
18
17
19
The worker name is set in `wrangler.jsonc` (currently `storefront-tanstack-template`). Rename it in your fork to avoid colliding with other workers on the same Cloudflare account.
18
20
19
-
## Preview (`preview.yml`)
21
+
## Preview (Cloudflare Workers Builds)
20
22
21
-
Triggers:
23
+
Per-PR previews are produced by the Cloudflare **Workers Builds** GitHub App,
24
+
configured on the Cloudflare dashboard (not by a workflow in this repo). On each
25
+
PR it builds the branch and posts a sticky comment with a **Commit Preview URL**
26
+
(immutable, per-commit) and a **Branch Preview URL** (stable per branch). These
27
+
are isolated versions and do not replace the production deployment.
22
28
23
-
-`pull_request` — opened, synchronize, reopened
24
-
-`push` to branches matching `env/**` (e.g. `env/staging`)
25
-
-`repository_dispatch` with type `preview-deploy` (for external triggers)
26
-
27
-
What it does:
28
-
29
-
1. Computes a preview alias:
30
-
-`env/staging` → `staging`
31
-
- PR #42 → `pr-42`
32
-
- any other ref → slug (`[^a-z0-9-]` replaced with `-`)
-**Alias URL** — stable, overwritten on each push for the same alias
38
-
5. Posts a sticky comment on the PR (header `preview-url`) with both URLs
39
-
40
-
`wrangler versions upload` does **not** replace the production deployment — it creates an isolated version that only traffic hitting the preview URLs reaches. Production is promoted manually via the Cloudflare dashboard or `wrangler versions deploy`.
29
+
> The previous `preview.yml` workflow was removed — it duplicated this and was
30
+
> failing on every PR (`bun: not found`, it never set up Bun). Workers Builds
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,9 +193,9 @@ Override per-route in `src/cache-config.ts`.
193
193
194
194
Cloudflare Workers via Wrangler. Configuration is in `wrangler.jsonc` (entry: `src/worker-entry.ts`).
195
195
196
-
Two GitHub Actions workflows handle CI/CD automatically (see [`.github/workflows/README.md`](./.github/workflows/README.md)):
196
+
CI/CD is automatic (see [`.github/workflows/README.md`](./.github/workflows/README.md)):
197
197
198
-
-**`preview.yml`** — on every PR, uploads a versioned preview via `wrangler versions upload --preview-alias`and posts the URL as a sticky comment. Skips gracefully if Cloudflare secrets aren't configured.
198
+
-**Per-PR previews** — the Cloudflare **Workers Builds** GitHub App builds each PR and posts a sticky comment with the Commit/Branch preview URLs.
199
199
-**`deploy.yml`** — on push to `main`, runs `wrangler deploy` with `BUILD_HASH` injected.
0 commit comments