Skip to content

Commit

Permalink
doc: build document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 6, 2022
1 parent 512b48f commit daad8b5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 31 deletions.
51 changes: 40 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,60 @@ jobs:
website:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16

- run: mkdir -p build build/example
- run: cp -rp example build/example
- run: npm run build
- run: mkdir -p dist dist/example
- run: cp -rp example dist/example
# - run: npm i markdown-to-html-cli -g
# - run: markdown-to-html --output build/index.html

- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: build/CONTRIBUTORS.svg
output: dist/CONTRIBUTORS.svg
avatarSize: 42

- name: Converts Markdown to HTML
uses: jaywcjlove/markdown-to-html-cli@main
- name: Create Tag
id: create_tag
uses: jaywcjlove/[email protected]
with:
source: README.md
output: build/index.html
package-path: ./package.json

- name: get tag version
id: tag_version
uses: jaywcjlove/[email protected]

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_dir: ./dist

- name: Generate Changelog
id: changelog
uses: jaywcjlove/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)

- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
body: |
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/golang-tutorial/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--idoc:ignore:start-->
Go语言快速入门
===
<!--rehype:style=display: flex; height: 230px; align-items: center; justify-content: center; font-size: 38px;-->
<!--idoc:ignore:end-->

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

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

<!--idoc:ignore:start-->

目录
---

<details>
<summary>点击展开目录菜单</summary>

- [安装Go](#安装go)
- [运行Go](#运行go)
- [格式化输入输出](#格式化输入输出)
Expand All @@ -32,8 +32,7 @@ Go语言快速入门
- [结构体](#结构体)
- [资源导航](#资源导航)


</details>
<!--idoc:ignore:end-->

## 安装Go

Expand Down
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
{
"version": "1.0.0",
"title": "Go语言快速入门",
"title": "Go 语言快速入门",
"scripts": {
"start": "idoc --watch",
"build": "idoc"
},
"markdown-to-html": {
"github-corners": "https://github.com/jaywcjlove/golang-tutorial",
"document": {
"title": "Go 语言快速入门",
"meta": [
{
"description": "通过简单的例子,来快速入门Go语言基础编程、语法等各种语言特性,主要面向新手级别的学习者。"
},
{
"keywords": "golang,tutorial,go,golang-tutorial"
}
]
}
"repository": {
"type": "git",
"url": "https://github.com/jaywcjlove/golang-tutorial"
},
"devDependencies": {
"idoc": "^1.21.4"
Expand Down

0 comments on commit daad8b5

Please sign in to comment.