将你的 Astro 站点部署到 Zeabur
Zeabur 为全栈 Web 应用提供托管。Astro 网站可以作为 SSR 或静态输出托管。
¥Zeabur offers hosting for full-stack web applications. Astro sites can be hosted as both SSR or static output.
本指南包括通过网站 UI 部署到 Zeabur 的说明。
¥This guide includes instructions for deploying to Zeabur through the website UI.
项目配置
标题部分 项目配置¥Project Configuration
静态站点
标题部分 静态站点¥Static Site
Astro 默认输出静态站点。无需任何额外配置即可将静态 Astro 站点部署到 Zeabur。
¥Astro outputs a static site by default. There is no need for any extra configuration to deploy a static Astro site to Zeabur.
SSR 适配器
标题部分 SSR 适配器¥Adapter for SSR
要在你的 Astro 项目中启用 SSR 并在 Zeabur 上部署:
¥To enable SSR in your Astro project and deploy on Zeabur:
-
Install the
@zeabur/astro-adapter
adapter to your project’s dependencies using your preferred package manager. If you’re using npm or aren’t sure, run this in the terminal: -
Add two new lines to your
astro.config.mjs
project configuration file.
如何部署
标题部分 如何部署¥How to deploy
如果项目存储在 GitHub 中,你可以将 Astro 网站部署到 Zeabur。
¥You can deploy your Astro site to Zeabur if the project is stored in GitHub.
-
Click Create new project in the Zeabur dashboard.
-
Configure GitHub installation and import the repository.
-
Zeabur will automatically detect that your project is an Astro project and will build it using the
astro build
command. -
Once the build is complete, you can bind a domain to your site and visit it.
在你的项目导入和部署后,所有后续推送到分支都将生成新版本。
¥After your project has been imported and deployed, all subsequent pushes to branches will generate new builds.
了解有关 Zeabur 的 部署指南 的更多信息。
¥Learn more about Zeabur’s Deployment Guide.