Skip to content

Commit daad8b5

Browse files
committed
doc: build document.
1 parent 512b48f commit daad8b5

File tree

3 files changed

+49
-31
lines changed

3 files changed

+49
-31
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,60 @@ jobs:
88
website:
99
runs-on: ubuntu-20.04
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 14
14+
node-version: 16
1515

16-
- run: mkdir -p build build/example
17-
- run: cp -rp example build/example
16+
- run: npm run build
17+
- run: mkdir -p dist dist/example
18+
- run: cp -rp example dist/example
1819
# - run: npm i markdown-to-html-cli -g
1920
# - run: markdown-to-html --output build/index.html
2021

2122
- name: Generate Contributors Images
2223
uses: jaywcjlove/github-action-contributors@main
2324
with:
2425
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
25-
output: build/CONTRIBUTORS.svg
26+
output: dist/CONTRIBUTORS.svg
2627
avatarSize: 42
2728

28-
- name: Converts Markdown to HTML
29-
uses: jaywcjlove/markdown-to-html-cli@main
29+
- name: Create Tag
30+
id: create_tag
31+
uses: jaywcjlove/[email protected]
3032
with:
31-
source: README.md
32-
output: build/index.html
33+
package-path: ./package.json
34+
35+
- name: get tag version
36+
id: tag_version
37+
uses: jaywcjlove/[email protected]
3338

3439
- name: Deploy
3540
uses: peaceiris/actions-gh-pages@v3
3641
with:
42+
user_name: 'github-actions[bot]'
43+
user_email: 'github-actions[bot]@users.noreply.github.com'
44+
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
3745
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./build
46+
publish_dir: ./dist
47+
48+
- name: Generate Changelog
49+
id: changelog
50+
uses: jaywcjlove/[email protected]
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
54+
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
55+
56+
- name: Create Release
57+
uses: ncipollo/release-action@v1
58+
if: steps.create_tag.outputs.successful
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
name: ${{ steps.create_tag.outputs.version }}
62+
tag: ${{ steps.create_tag.outputs.version }}
63+
body: |
64+
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/golang-tutorial/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
65+
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
66+
67+
${{ steps.changelog.outputs.changelog }}

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
<!--idoc:ignore:start-->
12
Go语言快速入门
23
===
3-
<!--rehype:style=display: flex; height: 230px; align-items: center; justify-content: center; font-size: 38px;-->
4+
<!--idoc:ignore:end-->
45

56
[![CI](https://github.com/jaywcjlove/golang-tutorial/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/golang-tutorial/actions/workflows/ci.yml)
67

@@ -15,12 +16,11 @@ Go语言快速入门
1516
- GOPATH 目录下新建 `bin` 目录,该目录用于存放项目中所生成的可执行文件。
1617
- GOPATH 目录下新建 `pkg` 目录,该目录用于存放编译生成的库文件。
1718

19+
<!--idoc:ignore:start-->
20+
1821
目录
1922
---
2023

21-
<details>
22-
<summary>点击展开目录菜单</summary>
23-
2424
- [安装Go](#安装go)
2525
- [运行Go](#运行go)
2626
- [格式化输入输出](#格式化输入输出)
@@ -32,8 +32,7 @@ Go语言快速入门
3232
- [结构体](#结构体)
3333
- [资源导航](#资源导航)
3434

35-
36-
</details>
35+
<!--idoc:ignore:end-->
3736

3837
## 安装Go
3938

package.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
{
22
"version": "1.0.0",
3-
"title": "Go语言快速入门",
3+
"title": "Go 语言快速入门",
44
"scripts": {
55
"start": "idoc --watch",
66
"build": "idoc"
77
},
8-
"markdown-to-html": {
9-
"github-corners": "https://github.com/jaywcjlove/golang-tutorial",
10-
"document": {
11-
"title": "Go 语言快速入门",
12-
"meta": [
13-
{
14-
"description": "通过简单的例子,来快速入门Go语言基础编程、语法等各种语言特性,主要面向新手级别的学习者。"
15-
},
16-
{
17-
"keywords": "golang,tutorial,go,golang-tutorial"
18-
}
19-
]
20-
}
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/jaywcjlove/golang-tutorial"
2111
},
2212
"devDependencies": {
2313
"idoc": "^1.21.4"

0 commit comments

Comments
 (0)