Skip to content

Commit 5a230f9

Browse files
committed
docs(cn): add heroku deploy instructions (#366)
1 parent 9e3f005 commit 5a230f9

File tree

2 files changed

+68
-17
lines changed

2 files changed

+68
-17
lines changed

docs/guide/deploy.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -137,33 +137,35 @@ You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-do
137137

138138
1. First install [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
139139

140-
2. Heroku Account – [sign up here](https://signup.heroku.com).
140+
2. Create a Heroku account [here](https://signup.heroku.com).
141141

142-
3. Run heroku login in your terminal or command prompt and fill in your Heroku credentials.
142+
3. Run `heroku login` and fill in your Heroku credentials:
143+
144+
``` bash
145+
heroku login
146+
```
143147

144-
``` bash
145-
heroku login
146-
```
148+
4. Create a file called `static.json` in the root of your project with the content below:
147149

148-
4. Create a file called `static.json` in the root of your project with the content below. This is the configuration of your site. see more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).
150+
`static.json`:
151+
```json
152+
{
153+
"root": "./docs/.vuepress/dist"
154+
}
155+
```
149156

150-
`static.json`:
151-
```json
152-
{
153-
"root": "./docs/.vuepress/dist"
154-
}
155-
```
157+
This is the configuration of your site. see more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).
156158

157-
5. Set up your heroku git remote
159+
5. Set up your Heroku git remote:
158160

159161
``` bash
160162
# version change
161163
git init
162164
git add .
163165
git commit -m "My site ready for deployment."
164166
165-
# created app heroku (personalize name for the app)
166-
heroku apps:create my-static-site-example
167+
# creates a new app with a specified name
168+
heroku apps:create example
167169
168170
# set buildpack for static sites
169171
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
@@ -175,6 +177,6 @@ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
175177
# publish site
176178
git push heroku master
177179
178-
# open site for visualize result
180+
# opens a browser to view the Dashboard version of Heroku CI
179181
heroku open
180182
```

docs/zh/guide/deploy.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,53 @@ pages:
129129

130130
3. 想要使用 surge 来部署,你可以运行: `surge docs/.vuepress/dist`;
131131

132-
你也可以通过 `surge docs/.vuepress/dist yourdomain.com` 来部署到 [自定义域名](http://surge.sh/help/adding-a-custom-domain)。
132+
你也可以通过 `surge docs/.vuepress/dist yourdomain.com` 来部署到 [自定义域名](http://surge.sh/help/adding-a-custom-domain)。
133+
134+
135+
## Heroku
136+
137+
1. 首先安装 [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli);
138+
139+
2. [在这里](https://signup.heroku.com) 注册一个 Heroku 账号;
140+
141+
3. 运行 `heroku login` 并填写你的 Heroku 证书:
142+
143+
``` bash
144+
heroku login
145+
```
146+
147+
4. 在你的项目根目录中,创建一个名为 `static.json` 的文件,并包含下述内容:
148+
149+
`static.json`:
150+
```json
151+
{
152+
"root": "./docs/.vuepress/dist"
153+
}
154+
```
155+
156+
这里是你项目的配置,请参考 [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static) 了解更多。
157+
158+
5. 配置 Heroku 的 git 远程仓库:
159+
160+
``` bash
161+
# 版本变化
162+
git init
163+
git add .
164+
git commit -m "My site ready for deployment."
165+
166+
# 以指定的名称创建一个新的 heroku 应用
167+
heroku apps:create example
168+
169+
# 为静态网站设置构建包
170+
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
171+
```
172+
173+
6. 部署你的网站:
174+
175+
``` bash
176+
# 发布网站
177+
git push heroku master
178+
179+
# 打开浏览器查看 Helku CI 的 dashboard
180+
heroku open
181+
```

0 commit comments

Comments
 (0)