Skip to content

Commit 0305842

Browse files
authored
Merge pull request #17 from deco-sites/jonasjesus/deco-5293-remove-broken-preview-workflow
ci: remove broken preview.yml — Workers Builds covers previews (DECO-5293)
2 parents c547cf4 + 95e9590 commit 0305842

3 files changed

Lines changed: 16 additions & 135 deletions

File tree

.github/workflows/README.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# CI workflows
22

3-
Two workflows manage Cloudflare Workers deployments for this storefront:
3+
Cloudflare Workers deployments for this storefront:
44

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`.
79

810
## Required secrets
911

@@ -16,28 +18,17 @@ Both workflows need the following GitHub secrets (Settings → Secrets and varia
1618

1719
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.
1820

19-
## Preview (`preview.yml`)
21+
## Preview (Cloudflare Workers Builds)
2022

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.
2228

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 `-`)
33-
2. Runs `npm install && npm run build`
34-
3. Runs `npx wrangler versions upload --preview-alias <alias>`
35-
4. Parses the two URLs from wrangler output:
36-
- **Version URL** — immutable, unique per upload
37-
- **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
31+
> covers preview end to end.
4132
4233
## Deploy (`deploy.yml`)
4334

.github/workflows/preview.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ Override per-route in `src/cache-config.ts`.
193193

194194
Cloudflare Workers via Wrangler. Configuration is in `wrangler.jsonc` (entry: `src/worker-entry.ts`).
195195

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)):
197197

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.
199199
- **`deploy.yml`** — on push to `main`, runs `wrangler deploy` with `BUILD_HASH` injected.
200200

201201
Required repo secrets: `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID`.

0 commit comments

Comments
 (0)