title | description | type | i18nReady |
---|---|---|---|
AstroサイトをKinstaのアプリケーションホスティングにデプロイする |
KinstaのアプリケーションホスティングにAstroサイトをデプロイする方法。 |
deploy |
true |
import { Steps } from '@astrojs/starlight/components';
Kinstaのアプリケーションホスティングを利用して、クラウドホスティング上でAstroサイトをホストできます。
:::tip[例をお探しですか?] Astroのための公式Kinstaアプリケーションホスティングスタータープロジェクトをチェックしてみてください! :::
Kinstaのアプリケーションホスティングであなたのプロジェクトをホストするには、次のことが必要です。
package.json
にname
フィールドを含めます。(これは何でもよく、デプロイには影響しません。)package.json
にbuild
スクリプトを含めます。(あなたのAstroプロジェクトは既にこれを含んでいるはずです。)serve
パッケージをインストールし、start
スクリプトをserve dist/
に設定します。
以下は、package.json
ファイルに必要な行です。
{
"name": "anything", // これは必須ですが、値はなんでも良いです。
"scripts": {
"dev": "astro dev",
"start": "serve dist/",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^2.2.0",
"serve": "^14.0.1"
},
}
:::tip[例をお探しですか?] Astro SSRのための公式Kinstaアプリケーションホスティングスタータープロジェクトをチェックしてみてください! :::
Kinstaのアプリケーションホスティングであなたのプロジェクトをホストするには、次のことが必要です。
package.json
にname
フィールドを含めます。(これは何でもよく、デプロイには影響しません。)package.json
にbuild
スクリプトを含めます。(あなたのAstroプロジェクトは既にこれを含んでいるはずです。)astrojs/node
パッケージをインストールし、start
スクリプトをnode ./dist/server/entry.mjs
に設定します。astro.config.mjs
で@astrojs/node
を使用し、host: true
を使用するように設定します。
以下は、package.json
ファイルに必要な行です。
{
"name": "anything", // これは必須ですが、値はなんでも良いです。
"scripts": {
"dev": "astro dev",
"start": "node ./dist/server/entry.mjs",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^2.2.0",
"@astrojs/node": "^5.1.1"
},
}
以下は、astro.config.mjs
ファイルに必要な行です。
import { defineConfig } from 'astro/config';
import node from "@astrojs/node";
export default defineConfig({
output: 'server',
adapter: node({
mode: "standalone"
}),
server: {
host: true
}
});
プロジェクトのGitHubリポジトリが接続されると、MyKinsta管理パネルでKinstaのアプリケーションホスティングへの手動デプロイをトリガーできます。また、管理パネルで自動デプロイを設定できます。
1. [MyKinsta](https://my.kinsta.com/)管理パネルにアクセスします。-
アプリケーションタブに移動します。
-
GitHubリポジトリを接続します。
-
アプリケーション > アプリケーションを追加ボタンを押します。
-
ウィザードの手順に従ってください。
-
アプリケーションがデプロイされます。