将你的 Astro 网站部署到 Zephyr Cloud
你可以使用 Zephyr Cloud 部署具有智能资源管理、全面构建分析和对模块联合架构的一流支持的 Astro 站点。
¥You can use Zephyr Cloud to deploy an Astro site with intelligent asset management, comprehensive build analytics, and first-class support for Module Federation architectures.
Zephyr 采用自带云 (BYOC) 模型,可通过统一界面部署到你选择的 支持的云平台,无需担心厂商锁定。随时切换提供商,无需更改部署工作流程。
¥Zephyr operates on a Bring Your Own Cloud (BYOC) model, deploy to your choice of supported clouds through a unified interface without vendor lock-in. Switch providers anytime without changing your deployment workflow.
¥How to deploy
¥Automatic Installation
-
Add the Zephyr integration to your Astro project with the following command. This will install the integration and update your
astro.config.mjsfile automatically:终端窗口 npx with-zephyr@latest终端窗口 pnpm dlx with-zephyr@latest终端窗口 yarn dlx with-zephyr@latest -
Build and deploy your Astro site:
终端窗口 npm run build终端窗口 pnpm run build终端窗口 yarn run build -
Your application is deployed! Zephyr will provide a deployment URL and comprehensive build analytics.
¥Manual Installation
-
Install the Zephyr Astro integration:
终端窗口 npm install zephyr-astro-integration终端窗口 pnpm add zephyr-astro-integration终端窗口 yarn add zephyr-astro-integration -
Add the integration to your
astro.config.mjs:import { defineConfig } from 'astro/config';import { withZephyr } from 'zephyr-astro-integration';export default defineConfig({integrations: [withZephyr(),],}); -
Build and deploy your Astro site:
终端窗口 npm run build终端窗口 pnpm run build终端窗口 yarn run build -
Your application is deployed! Zephyr will provide a deployment URL and comprehensive build analytics.
¥More details
有关更多详细信息,请参阅 关于使用 Astro 部署的 Zephyr 云文档 文档。
¥For more detailed information refer to the Zephyr Cloud documentation on deploying with Astro.
部署期间会发生什么
Section titled “部署期间会发生什么”¥What happens during deployment
使用 Zephyr 集成构建 Astro 网站时,会发生以下过程:
¥When you build your Astro site with the Zephyr integration, the following process occurs:
- 构建上下文提取:Zephyr 捕获 Git 信息(提交、分支、作者)和包元数据
- 资源哈希:所有构建输出均使用 SHA-256 进行哈希处理,以便进行内容寻址存储。
- 增量检测:Zephyr 查询 CDN 边缘以确定哪些资源已存在
- 优化上传:仅上传新的或修改过的资源
- 创建快照:创建了一个包含所有资源引用的不可变部署快照。
- 分析上传:构建统计信息、模块图表和依赖信息会发送到控制面板。
- CDN 部署:资源将发布到你配置的 CDN,并带有永久缓存标头。
¥Official Resources