Skip to content

将你的网站部署到网络上

Get ready to…

  • 将你的 GitHub 存储库添加为新的 Netlify 应用

  • 将你的 Astro 站点部署到网络上

在这里,你将把 GitHub 存储库连接到 Netlify。每次你对代码进行更改时,Netlify 都会使用该项目在网络上实时构建和部署你的网站。

¥Here, you will connect your GitHub repository to Netlify. Netlify will use that project to build and deploy your site live on the web every time you commit a change to your code.

创建一个新的 Netlify 站点

Section titled 创建一个新的 Netlify 站点

¥Create a new Netlify site

  1. Create a free account at Netlify if you do not already have one.

    Make a note of your username. You will view your dashboard and any sites you create at https://app.netlify.com/teams/username

  2. Click Add new site > Import an existing project.

    You will be asked to connect to a Git provider. Choose GitHub and follow the steps onscreen to authenticate your GitHub account. Then, choose your Astro project’s GitHub repository from the list provided.

  3. At the final step, Netlify will show you your app’s site settings. The defaults should be correct for your Astro project, so you can scroll down and click Deploy site.

恭喜,你拥有 Astro 网站!

¥Congratulations, you have an Astro website!

¥Change your project name

在 Netlify 网站的概述页面上,你将看到随机生成的项目名称以及 https://project-name-123456.netlify.app 形式的网站 URL。你可以将项目名称更改为更容易记住的名称,这将自动更新你的 URL。

¥On your site’s overview page in Netlify, you will see your randomly-generated project name, and your website URL of the form https://project-name-123456.netlify.app. You can change your project name to something more memorable, and this will automatically update your URL.

¥Visit your new website

单击站点设置中的 URL,或将其输入浏览器窗口以查看你的新网站。

¥Click on the URL in your site settings, or type it into a browser window to view your new website.

¥Test your knowledge

你想要更新现有网站的主页。你采取什么步骤?

¥You want to update the home page of your existing website. What steps do you take?

¥Checklist

¥Resources

Astro 中文网 - 粤ICP备13048890号