Skip to content

使用 DeployHQ 部署你的 Astro 网站

你可以使用 DeployHQ(一个部署自动化平台)将你的 Astro 项目部署到你自己的服务器。DeployHQ 可以构建你的代码并将其推送到 SSH/SFTP 服务器、FTP 服务器、云存储(例如 Amazon S3、Cloudflare R2)和现代托管平台(例如 Netlify、Heroku)。

¥You can deploy your Astro project to your own servers using DeployHQ, a deployment automation platform that builds your code and pushes it to SSH/SFTP servers, FTP servers, cloud storage (e.g. Amazon S3, Cloudflare R2), and modern hosting platforms (e.g. Netlify, Heroku).

¥How to deploy

  1. If you do not already have one, sign up for a DeployHQ account.

  2. From the DeployHQ web interface, create a new project and connect the Git repository for your Astro project (GitHub, GitLab, Bitbucket, or any private repository). You will also need to authorize DeployHQ to access your repository.

  3. Add a server and enter your server details:

    • Give your server a name.
    • Select your protocol (SSH/SFTP, FTP, or cloud platform).
    • Enter your server hostname, username, and password/SSH key.
    • Set Deployment Path to your web root (e.g. public_html/).
  4. In your project settings, navigate to Build Pipeline and add your build commands:

    终端窗口
    npm install
    npm run build
  5. Click Deploy Project, then select your server and click Deploy to start your first deployment.

你的 Astro 站点将被构建并部署到你的服务器。你可以启用自动部署,以便在每次 Git 推送时自动部署,也可以安排在特定时间进行部署。

¥Your Astro site will be built and deployed to your server. You can enable automatic deployments to deploy on every Git push, or schedule deployments for specific times.

See DeployHQ’s documentation for more info on advanced deployment features.

更多部署指南

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