Astroアプリをデプロイ
Astro ships static HTML by default — you only reach for a server adapter if you opt into one. For a default project, npm run build is already producing exactly what this host wants.
- 01
Build the site
Run "npm run build" (or "astro build" directly). Astro pre-renders every page to static HTML in a "dist" folder, plus a hashed, cacheable "_astro" assets folder.
- 02
Confirm you haven't added a server adapter
If astro.config.mjs sets "output: 'server'" or "'hybrid'" with an adapter (Node, Vercel, Cloudflare…), some routes render on request and won't exist as files. The default, adapter-free config is fully static.
- 03
デプロイする
プロジェクトのルートで「npx harvis deploy dist」を実行してください。この最初のデプロイに設定もログインも不要 — すぐに公開URLが手に入り、いつでも無料アカウントにサイトを紐付けられる非公開のオーナー登録リンクも一緒に発行されます。
Astroをコマンド1つでデプロイ
プロジェクトをビルドして、出力フォルダをharvisに渡すだけ。最初のデプロイにアカウントは不要 — 公開リンクと、あとで管理するための非公開のオーナー登録リンクが手に入ります。
npm run build npx harvis deploy dist
ターミナルよりファイルをドラッグする方が好みですか?プロジェクトをビルドしたら、出力フォルダをここにドロップすれば同じように公開できます。
Deploy Astro on every git push
The command above is one you will run again after every change. A git hook runs it for you: this one already points at dist, the folder Astro builds into.
The folder holding the finished site. "." is the repo root, which is right for hand-written HTML; a static-site generator writes somewhere else.
pre-push fires on every branch and every remote, so a feature branch would publish over your live site. With this on, a push from anywhere else exits early and goes through untouched.
cat > .git/hooks/pre-push <<'EOF' #!/bin/sh set -e npm run build harvis deploy dist EOF chmod +x .git/hooks/pre-push
The options, the gotchas and how to share a hook with your team are on the git hook page.
Astroのデプロイに関する質問
I'm using Astro islands with React or Vue components. Does that still work?
Yes — islands hydrate in the browser after the static HTML loads, so they don't need a server at request time. The framework code ships as regular JavaScript in the dist folder like any other asset.
What if I need server-rendered routes for one page?
Static hosting can't run per-request server code, full stop. Either keep that route external (calling your own API from client-side JS is fine) or split it out and host it somewhere that runs a server — the rest of the Astro site can still live here.
Astroアプリをharvisにデプロイするのは本当に無料ですか?
はい、クレジットカードは不要です。無料枠は1サイトあたり500ファイル・50 MBで、静的なAstroのビルドなら十分すぎるほどです。公開したサイトに有効期限はなく、削除するまで公開され続けます。
デプロイしたAstroサイトに独自ドメインは使えますか?
どのサイトも無料のharvis.pageアドレスが割り当てられ、オーナー登録後にダッシュボードから好きなサブドメインを選べます(ランダムな名前の代わりにmy-app.harvis.pageのように)。すでに持っている独自ドメイン(mystore.comなど)をサイトに向ける機能は、まだ用意されていません。
AstroをVercelやNetlifyにデプロイするのと何が違いますか?
VercelやNetlifyは、Gitリポジトリを接続してビルドを自分たちのサーバー上で実行し、ダッシュボードで設定する仕組みが中心です。harvisはそれをすべて省略します。ローカル(または自分のCI)でビルドし、出力フォルダに対してCLIコマンドを1つ実行するだけでリンクが手に入ります — プロジェクトの設定も、サイトを残しておきたくなるまでのアカウントも不要です。
別のものをデプロイしますか?
手順はどれでも同じです — ビルドしてから、出力フォルダをnpx harvis deployするだけ。