使用命令行接口 (CLI) 进行项目部署
🌐 Project deployment with the Command Line Interface (CLI)
这是一个逐步指南,教你如何首次使用命令行接口在 Strapi Cloud 上部署你的项目。
🌐 This is a step-by-step guide for deploying your project on Strapi Cloud for the first time, using the Command Line Interface.
Prerequisites
在使用命令行接口将你的 Strapi 应用部署到 Strapi Cloud 之前,你需要具备以下先决条件:
🌐 Before you can deploy your Strapi application on Strapi Cloud using the Command Line Interface, you need to have the following prerequisites:
- 拥有一个 Google、GitHub 或 GitLab 账号。
- 拥有一个已创建的 Strapi 项目(参见 CMS 文档中的 从 CLI 安装),存储在本地。项目必须小于 100MB。
- 确保你的硬盘中有可用存储空间,用于存放操作系统的临时文件夹。
登录 Strapi 云
🌐 Logging in to Strapi Cloud
- 打开你的终端。
- 导航到存储在本地电脑上的 Strapi 项目的文件夹。
- 输入以下命令以登录 Strapi Cloud:
- Yarn
- NPM
yarn strapi login
npx run strapi login
- 在自动打开的浏览器窗口中,确认显示的代码与终端消息中写的代码相同。
- 仍然在浏览器窗口中,选择通过 Google、GitHub 或 GitLab 登录。窗口应在不久后确认登录成功。
部署你的项目
🌐 Deploying your project
- 在你的终端中,仍然在你的 Strapi 项目文件夹中,输入以下命令来部署项目:
- Yarn
- NPM
yarn strapi deploy
npx run strapi deploy
- 在终端中关注进度条,直到确认项目已成功使用 Strapi Cloud 部署。部署项目将会在免费计划下创建一个新的 Strapi Cloud 项目。