Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merage go-zero-doc #62

Merged
merged 2 commits into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
ACCESSTOKEN=$1
REPO="https://x-access-token:${ACCESSTOKEN}@github.com/zeromicro/go-zero-pages.git"

# git 配置
echo "git基础配置"
git config --global user.name "anqiansong"
git config --global user.email "anqiansong@tal.com"

# push
cd ./go-zero.dev
mkdir ./doc
cd ./doc
echo $PWD
echo "document clone..."
git clone ${REPO}
cd go-zero-pages
rm -rf ./*
cp -rf ../../_book/* .
git add ./*
git commit -m 'update document'
echo "document push..."
git push -f
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 当master有代码提交或者有pr时,自动build gitbook,并覆盖git@github.com:zeromicro/go-zero.git仓库中内容
# 以实现自动发布文档

name: Document Build

on:
push:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: enter work dir
run: cd go-zero.dev
- name: checkout code
uses: actions/checkout@v2
- name: chmod contributor tool
run: chmod +x ../.github/workflows/contributor-tool
- name: get latest contributors(cn)
run: ../.github/workflows/contributor-tool -f contributor -l zh -o ./cn/contributor.md
- name: get latest contributors(en)
run: ../.github/workflows/contributor-tool -f contributor -l en -o ./en/contributor.md
- name: use node.js
uses: actions/setup-node@v1
with:
node-version: '12.18.1'
- name: install gitbook
run: npm install gitbook-cli -g
- name: gitbook version
run: gitbook --version
- name: gitbook install
run: gitbook install
- name: build
run: gitbook build
- name: delete original index
run: rm -f ./_book/index.html
- name: build index
run: ../.github/workflows/contributor-tool -i ./_book/index.html
- name: chmod
run: chmod +x ./.github/workflows/build.sh
- name: publish
run: ../.github/workflows/build.sh ${{ secrets.ACCESSTOKEN }}
shell: bash
Binary file added .github/workflows/contributor-tool
Binary file not shown.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 好未来技术
Copyright (c) 2020 zeromicro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 0 additions & 5 deletions doc/breaker.md

This file was deleted.

Loading