Skip to content

Commit

Permalink
feat(cli): add github page deploy desc to templates (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored Sep 30, 2024
1 parent 713e7bc commit 25c4a78
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cli/templates/common/README.md.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,24 @@ npm run docs:preview
npm run vp-update
```
{{/if}}
{{#if (equal deploy "github")}}

## Deploy to GitHub Pages

The plume theme has been created with GitHub Actions: `.github/workflows/docs-deploy.yml`. You also need to make the following settings in the GitHub repository:

- [ ] `settings > Actions > General`, Scroll to the bottom of the page, under `Workflow permissions`, check `Read and write permissions`, and click the save button.

- [ ] `settings > Pages`, In `Build and deployment`, select `Deploy from a branch` for `Source`, choose `gh-pages` for `Branch`, and click the save button.
(The `gh-pages` branch may not exist upon first creation. You can complete the above setup first, push the code to the main branch, wait for `github actions` to finish, and then proceed with the setup.)

- [ ] Modify the `base` option in `docs/.vuepress/config.ts`:
- If you are planning to deploy to `https://<USERNAME>.github.io/`, you can skip this step as `base` defaults to `"/"`.
- If you are planning to deploy to `https://<USERNAME>.github.io/<REPO>/`, meaning your repository URL is `https://github.com/<USERNAME>/<REPO>`, set `base` to `"/<REPO>/"`.

To customize a domain name, please refer to [Github Pages](https://docs.github.com/zh/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)

{{/if}}
## Documents

- [vuepress](https://vuepress.vuejs.org/)
Expand Down
17 changes: 17 additions & 0 deletions cli/templates/common/README.zh-CN.md.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,24 @@ npm run docs:preview
npm run vp-update
```
{{/if}}
{{#if (equal deploy "github")}}

## 部署到 GitHub Pages

主题已创建 github actions: `.github/workflows/docs-deploy.yml`,你还需要在 github 仓库中进行以下设置:

- [ ] `settings > Actions > General`,拉到页面底部,在 `Workflow permissions` 下,勾选 `Read and write permissions`,并点击保存按钮

- [ ] `settings > Pages`, 在 `Build and deployment` 中,`Source` 选择 `Deploy from a branch`, `Branch` 选择 `gh-pages`,并点击保存按钮
(首次创建可能没有 `gh-pages`分支,你可以先完成上面的设置后,推送一次代码到主分支,等待 `github actions` 完成后再进行设置)

- [ ] 修改 `docs/.vuepress/config.ts` 中的 `base` 选项:
- 如果你准备发布到 `https://<USERNAME>.github.io/` ,你可以省略这一步,因为 `base` 默认就是 `"/"` 。
- 如果你准备发布到 `https://<USERNAME>.github.io/<REPO>/` ,也就是说你的仓库地址是 `https://github.com/<USERNAME>/<REPO>` ,则将 `base` 设置为 `"/<REPO>/"`。

如需要自定义域名,请查看 [Github Pages 文档](https://docs.github.com/zh/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)

{{/if}}
## 文档

- [vuepress](https://vuepress.vuejs.org/)
Expand Down

0 comments on commit 25c4a78

Please sign in to comment.