Skip to content

将你的 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

  1. Add the Zephyr integration to your Astro project with the following command. This will install the integration and update your astro.config.mjs file automatically:

    终端窗口
    npx with-zephyr@latest
  2. Build and deploy your Astro site:

    终端窗口
    npm run build
  3. Your application is deployed! Zephyr will provide a deployment URL and comprehensive build analytics.

¥Manual Installation

  1. Install the Zephyr Astro integration:

    终端窗口
    npm install zephyr-astro-integration
  2. Add the integration to your astro.config.mjs:

    import { defineConfig } from 'astro/config';
    import { withZephyr } from 'zephyr-astro-integration';
    export default defineConfig({
    integrations: [
    withZephyr(),
    ],
    });
  3. Build and deploy your Astro site:

    终端窗口
    npm run build
  4. 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.

¥What happens during deployment

使用 Zephyr 集成构建 Astro 网站时,会发生以下过​​程:

¥When you build your Astro site with the Zephyr integration, the following process occurs:

  1. 构建上下文提取:Zephyr 捕获 Git 信息(提交、分支、作者)和包元数据
  2. 资源哈希:所有构建输出均使用 SHA-256 进行哈希处理,以便进行内容寻址存储。
  3. 增量检测:Zephyr 查询 CDN 边缘以确定哪些资源已存在
  4. 优化上传:仅上传新的或修改过的资源
  5. 创建快照:创建了一个包含所有资源引用的不可变部署快照。
  6. 分析上传:构建统计信息、模块图表和依赖信息会发送到控制面板。
  7. CDN 部署:资源将发布到你配置的 CDN,并带有永久缓存标头。

¥Official Resources

更多部署指南

Astro v5.16 中文网 - 粤ICP备13048890号