Repository navigation
feat: branch previews with Worker Previews - #40
Merged
Merged
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feat-worker-previews-kanban-web.ut-code.workers.dev (commit 10ceaea)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
…ers keep their settings
This was referenced Oct 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3
Supersedes #39
プレビューを、別の Worker (
kanban-web-preview) から、Cloudflare の Worker Previews (2026 年 9 月公開、オープンベータ) に切り替えた。同じ Worker (kanban-web) のまま、ブランチごとに独立したプレビューができる。できるようになったこと
https://<ブランチ名>-kanban-web.ut-code.workers.dev。複数のブランチを同時に見られるwrangler preview --name … --var BETTER_AUTH_URL:<そのプレビューの URL>で渡す。アプリの認証のコードは変えていない変更
wrangler.jsoncのenv.previewを消し、previewsブロックを足した。D1、R2、キューは、指定しないと本番と共有されるので、プレビュー用の既存のもの (kanban-db-previewなど) を指定したscripts/deploy-preview.sh: ブランチ名 (WORKERS_CI_BRANCH) からプレビュー名を作り、プレビュー用の D1 にマイグレーションを適用して、wrangler previewを実行する。Workers Builds の「Non-production deploy command」に使うapps/web/src/lib/preview-name.ts: ブランチ名をプレビュー名 (URL に使える形、63 文字の制限) にする純粋な関数とテストapps/web/wrangler.preview-migrations.jsonc: プレビュー用の D1 にマイグレーションを適用するためだけの設定 (d1 migrations applyはpreviewsブロックを読まないため)package.jsonに"type": "module"(スクリプトを Node で直接動かすため)docs/deploy.mdを書き直した (いまの状態、プレビューの仕組みと制約、Workers Builds の設定値)実際に確認したこと (ut-code のアカウント)
このブランチを、
https://feat-worker-previews-kanban-web.ut-code.workers.devにプレビューとしてデプロイして:Cloudflare 側でしたこと
BETTER_AUTH_SECRETを設定した (wrangler preview base-config secret put)kanban-web-previewを削除した。D1、R2、キューのプレビュー用のものは、使い回すので残したWorkers Builds の設定 (ダッシュボード) で変えてほしいこと
./scripts/deploy-preview.shscripts/**を足す