Web Analytics

3musketeers

⭐ 195 stars Japanese by flemay

3ムスケティアーズ

どこからでも同じ方法でアプリをテスト、ビルド、デプロイ!

[![ビルドステータス][linkGitHubActionsProjectBadge]][linkGitHubActionsProject] [![ライセンス][linkLicenseBadge]][linkLicense]

目次

概要

3ムスケティアは、ソフトウェアを繰り返しかつ一貫して開発するためのパターンです。 Makeをオーケストレーションツールとして活用し、DockerおよびDocker Composeを使用してアプリケーションのテスト、ビルド、実行、デプロイを行います。 各アプリケーションのMakeおよびDocker/Composeコマンドはアプリケーションのソースコードの一部として管理されており、ローカルまたはCI/CDサーバーで実行する場合でも同じ方法で呼び出されます。

[!NOTE]
詳細については、[公式ウェブサイト][link3Musketeers]をご覧ください。

3ムスケティアのウェブサイト

このリポジトリは、[Astro Starlight][linkAstroStarlight]で構築された[3ムスケティアのウェブサイト][link3Musketeers]です。 このセクションでは、3ムスケティアの手法を用いた開発、テスト、デプロイ方法について説明します。

前提条件

開発

# Create a .env file
make envfile ENVFILE=env.example

Install dependencies

make deps copyDepsToHost

Format and check

make fmt check

Start Astro server for local development

make dev

Wait till the message 'dev-1 | 20:13:41 watching for file changes...' appears

Access the website in your browser at http://127.0.0.1:4321/

\ to stop

Build static site

make build

Serve static site for local development

make previewDev

Access the website in your browser at http://127.0.0.1:4321/

\ to stop

Serve static website in the background

make preview

Test static website

make testPreview

Clean

make clean

デプロイメント

3ムスケティアーズのウェブサイトは[Cloudflare Pages][linkCloudflarePages]にデプロイされています。 このセクションでは、[Wrangler CLI][linkCloudflareWranglerCLI]を使用してPagesプロジェクトを作成、デプロイ、削除する方法を示します。 これは新しい変更をプレビューするのに便利です。

ビルド、テスト、デプロイはGitHub Actionsで行われるため、 このセクションでは[Direct Upload][linkCloudflareDirectUpload]と [Run Wrangler in CI/CD][linkCloudflareWranglerCICD]の指示に従います。

[!NOTE]
このセクションでは静的サイトが
make buildで生成されている必要があります

#### 0. CloudflareアカウントIDとAPIトークン

Wrangler CLIを使用してCloudflare Pagesとやり取りするには、CloudflareアカウントIDと APIトークンが必要です。

#### 1. Envfile

以下のセクションでは.envファイルの値を使用します。正しい値で.envファイルを (env.templateを基に)作成してください。

例:

# .env
ENV_CLOUDFLARE_BRANCH_NAME=main
ENV_CLOUDFLARE_PROJECT_NAME=random-project-name
ENV_SECRET_CLOUDFLARE_ACCOUNT_ID=id-from-previous-section
ENV_SECRET_CLOUDFLARE_API_TOKEN=token-from-previous-section
検証:

make shell

Check the env vars are correctly set

env | grep ENV_

List current projects on CloudFlare

deno task deploy:list exit
#### 2. 作成

このセクションでは新しいPagesプロジェクトを作成します。このステップは ENV_CLOUDFLARE_PROJECT_NAMEがステップ1. Envfileに記載されていなかった場合のみ必要です。

make shell

Create a new project

deno task deploy:create

The new project and its domain should be listed

deno task deploy:list

Project is empty which should not be hosted

curl -I https://${ENV_CLOUDFLARE_PROJECT_NAME}.pages.dev #HTTP/2 522 #...

Exit the container

exit

#### 3. デプロイ

このセクションでは、既存のCloudflare Pagesプロジェクトにウェブサイトをデプロイします。

make shell

Deploy the files to the project

deno task deploy

Project is no longer empty!

curl -I https://${ENV_CLOUDFLARE_PROJECT_NAME}.pages.dev #HTTP/2 200 #...

Exit the container

exit

注:make deployも使用可能です。

#### 4. 削除

このセクションでは、Cloudflare Pagesプロジェクトの削除方法を示します。

make shell
deno task deploy:delete
#? Are you sure you want to delete ""? This action cannot be undone. › y

Check the project is no longer listed

deno task deploy:list exit

[!重要]
セクション
0. CloudflareアカウントIDとAPIトークンで作成したCloudFlareトークンは削除可能です

CI/CD

[GitHub Actions][linkGitHubActions] はPRのテストおよび main ブランチの変更をCloudflare Pagesにデプロイするために使用されています。

GitHub Actionsの[variables][linkGitHubActionsVariables]および [secrets][linkGitHubActionsSecrets]に設定されています

ビジュアル要素

./astro.config.mjsに設定されています

貢献

CONTRIBUTING.md

感謝は [contributors][linkContributors] に送ります。

ライセンス

[MIT][linkLicense]

[link3Musketeers]: https://3musketeers.pages.dev [linkArtegenceArticle]: https://artegence.com/blog/social-media-tags-guide-part-2-preparing-a-perfect-image-for-the-ogimage-tag/ [linkAstroStarlight]: https://starlight.astro.build/ [linkCloudflareCreateAPIToken]: https://dash.cloudflare.com/profile/api-tokens [linkCloudflareDirectUpload]: https://developers.cloudflare.com/pages/get-started/direct-upload/ [linkCloudflareFindAccountAndZoneIDs]: https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/ [linkCloudflarePages]: https://pages.cloudflare.com/ [linkCloudflareWranglerCICD]: https://developers.cloudflare.com/workers/wrangler/ci-cd/ [linkCloudflareWranglerCLI]: https://developers.cloudflare.com/workers/wrangler/ [linkCompose]: https://docs.docker.com/compose [linkContributors]: CONTRIBUTORS [linkDemo]: demo [linkDocker]: https://www.docker.com [linkFaviconio]: https://favicon.io [linkGitHubActions]: https://github.com/features/actions [linkGitHubActionsProject]: https://github.com/flemay/3musketeers/actions [linkGitHubActionsProjectBadge]: https://img.shields.io/github/actions/workflow/status/flemay/3musketeers/deploy.yml?style=for-the-badge&logo=github [linkGitHubActionsSecrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets [linkGitHubActionsVariables]: https://docs.github.com/en/actions/learn-github-actions/variables [linkLicense]: LICENSE [linkLicenseBadge]: https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge [linkMake]: https://www.gnu.org/software/make [linkMermaid]: https://mermaid.js.org/ [linkPatternOverview]: ./docs/guide/assets/diagrams-overview.svg [linkProcreate]: https://procreate.art/ [linkVHS]: https://github.com/charmbracelet/vhs

--- Tranlated By Open Ai Tx | Last indexed: 2026-02-20 ---