Skip to content

Commit 4a2e58f

Browse files
committed
docs: update Chinese translation for deploying.
1 parent a209665 commit 4a2e58f

File tree

2 files changed

+60
-4
lines changed

2 files changed

+60
-4
lines changed

docs/guide/deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You can also run the above script in your CI setup to enable automatic deploymen
6868

6969
3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content.
7070

71-
```
71+
```yaml
7272
image: node:9.11.1
7373

7474
pages:

docs/zh/guide/deploy.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
1.`docs/.vuepress/config.js` 中设置正确的 `base`
2020

21-
如果你打算发布到 `https://<USERNAME>.github.io/`,则可以省略这一步,因为 `base` 默认即是 `"/"`
21+
如果你打算发布到 `https://<USERNAME>.github.io/`,则可以省略这一步,因为 `base` 默认即是 `"/"`
2222

23-
如果你打算发布到 `https://<USERNAME>.github.io/<REPO>/`(也就是说你的仓库在 `https://github.com/<USERNAME>/REPO>`),则将 `base` 设置为 `"/<REPO>/"`
23+
如果你打算发布到 `https://<USERNAME>.github.io/<REPO>/`(也就是说你的仓库在 `https://github.com/<USERNAME>/REPO>`),则将 `base` 设置为 `"/<REPO>/"`
2424

2525
2. 在你的项目中,创建一个如下的 `deploy.sh` 文件(请自行判断去掉高亮行的注释):
2626

@@ -56,11 +56,67 @@ cd -
5656
你可以在你的持续集成的设置中,设置在每次 push 代码时自动运行上述脚本。
5757
:::
5858

59+
## GitLab Pages and GitLab CI
60+
61+
1.`docs/.vuepress/config.js` 中设置正确的 `base`
62+
63+
如果你打算发布到 `https://<USERNAME or GROUP>.gitlab.io/`,则可以省略这一步,因为 `base` 默认即是 `"/"`
64+
65+
如果你打算发布到 `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`(也就是说你的仓库在 `https://gitlab.com/<USERNAME>/REPO>`),则将 `base` 设置为 `"/<REPO>/"`
66+
67+
2.`.vuepress/config.js` 中将 `dest` 设置为 `public`
68+
3. 在你项目的根目录下创建一个名为 `.gitlab-ci.yml` 的文件,无论何时你提交了更改,它都会帮助你自动构建和部署:
69+
70+
```yaml
71+
image: node:9.11.1
72+
73+
pages:
74+
cache:
75+
paths:
76+
- node_modules/
77+
78+
script:
79+
- npm install
80+
- npm run docs:build
81+
artifacts:
82+
paths:
83+
- public
84+
only:
85+
- master
86+
```
87+
5988
## Netlify
6089
61-
1. 在 Netlify 中, 创建一个新的 Github 项目,使用以下设置:
90+
1. 在 Netlify 中, 创建一个新的 Github 项目,使用以下设置
6291
6392
- **Build Command:** `npm run build-docs` 或者 `yarn build-docs`
6493
- **Publish directory:** `docs/.vuepress/dist`
6594

6695
2. 点击 deploy 按钮!
96+
97+
## Google Firebase
98+
99+
1. 请确保你已经安装了 [firebase-tools](https://www.npmjs.com/package/firebase-tools)。
100+
101+
2. 在你项目的根目录下创建 `firebase.json` 和 `.firebaserc`,并包含以下内容:
102+
103+
`firebase.json`:
104+
```json
105+
{
106+
"hosting": {
107+
"public": "./docs/.vuepress/dist",
108+
"ignore": []
109+
}
110+
}
111+
```
112+
113+
`.firebaserc`:
114+
```js
115+
{
116+
"projects": {
117+
"default": "<YOUR_FIREBASE_ID>"
118+
}
119+
}
120+
```
121+
122+
3. 在执行了 `yarn docs:build` 或 `npm run docs:build` 后, 使用 `firebase deploy` 指令来部署。

0 commit comments

Comments
 (0)