Skip to content

サイトのデプロイ

このページは、Timeline DSL 本体やこのドキュメントサイトを保守する開発者向けです。.tdsl ファイルを使って年表を作る利用者向けの手順ではありません。

このドキュメントサイトは Cloudflare Pages の GitHub integration で公開します。GitHub Actions は CI として pnpm build を確認し、公開と Preview URL の作成は Cloudflare Pages に任せます。

Cloudflare Pages project は timeline-dsl、production branch は main とします。

Cloudflare Pages の Build settings は以下にします。

SettingValue
Root directorysite
Build commandpnpm build
Build output directorydist
Deploy command設定項目が出ない

Cloudflare Pages の build image は dependency install を自動実行します。Build command に pnpm install --frozen-lockfile && pnpm build を入れても build はできますが、install が二重になるため pnpm build のみにします。

Deploy command が必須になっている場合や、非本番ブランチのデプロイコマンドが表示されている場合は、Pages ではなく Workers Builds の設定画面です。Workers Builds は build command の後に Wrangler の deploy command を実行する仕組みですが、このサイトは静的な Pages site として運用するため使いません。

Trigger用途Pages branch
pull_requestPreview deployment を作成PR branch
push to main本番公開main
release.publisheddeploy trigger としては使わない-
workflow_dispatchGitHub Actions の CI を手動再実行-

pull request では GitHub Actions の Site build workflow と Cloudflare Pages の Preview deployment がそれぞれ実行されます。

Cloudflare Pages の Preview URL は GitHub PR の checks、Deployments、または Cloudflare Pages dashboard から確認します。

  1. PR の Cloudflare Pages check または Deployments から Preview URL を開く。
  2. Preview URL で / が表示できることを確認する。
  3. Preview URL で /docs/ が表示できることを確認する。

Cloudflare build log に Worker NameExecuting user deploy command: npx wrangler deployNon-production branch deploy command が出ている場合は、Workers Builds として作成されています。Cloudflare dashboard で新しい Pages project を作成し、Pages の Import an existing Git repository からこの repository を接続してください。

Workers Builds として継続する場合は Wrangler 設定と Workers Static Assets 用の deploy command が必要になりますが、この LP/document サイトでは不要です。Missing file or directory: public/.assetsignore は Wrangler が Workers/Astro 用の追加セットアップを試みた結果で、Pages project として作り直すことで解消します。

参考:

Terminal window
cd site
pnpm install --frozen-lockfile
pnpm build