サイトのデプロイ
このページは、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 は以下にします。
| Setting | Value |
|---|---|
| Root directory | site |
| Build command | pnpm build |
| Build output directory | dist |
| 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 として運用するため使いません。
実行タイミング
Section titled “実行タイミング”| Trigger | 用途 | Pages branch |
|---|---|---|
pull_request | Preview deployment を作成 | PR branch |
push to main | 本番公開 | main |
release.published | deploy trigger としては使わない | - |
workflow_dispatch | GitHub Actions の CI を手動再実行 | - |
pull request では GitHub Actions の Site build workflow と Cloudflare Pages の Preview deployment がそれぞれ実行されます。
Preview 確認
Section titled “Preview 確認”Cloudflare Pages の Preview URL は GitHub PR の checks、Deployments、または Cloudflare Pages dashboard から確認します。
- PR の Cloudflare Pages check または Deployments から Preview URL を開く。
- Preview URL で
/が表示できることを確認する。 - Preview URL で
/docs/が表示できることを確認する。
Cloudflare build log に Worker Name、Executing user deploy command: npx wrangler deploy、Non-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 として作り直すことで解消します。
参考:
- Cloudflare Pages build configuration
- Cloudflare Workers Builds configuration
- Cloudflare Pages preview deployments
ローカル確認
Section titled “ローカル確認”cd sitepnpm install --frozen-lockfilepnpm build