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

ci: enhance cloud doc build workflow with typo checks and formatting #30650

Open
wants to merge 3 commits into
base: docs-cloud
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions .github/workflows/tdengine-doc-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: TDengine Doc Build
name: TDengine Doc Build and Check

on:
push:
branches:
- 'docs-cloud'

pull_request:
branches:
- 'main'
Expand All @@ -15,12 +19,46 @@ env:
EN_DOC_REPO: 'docs.tdengine.com'
TD_REPO: 'TDengine'
TOOLS_REPO: 'taos-tools'


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-docs-typos:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Use custom zh config file
uses: crate-ci/[email protected]
with:
files: 'docs/zh/**/*.md'
config: docs/typos.toml

- name: Use custom en config file
uses: crate-ci/[email protected]
with:
files: 'docs/en/**/*.md'
config: docs/typos.toml

check-docs-linter-formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: AutoCorrect
uses: huacnlee/autocorrect-action@v2
with:
args: --lint docs/zh/* docs/en/*

build-doc:
runs-on:
group: CI
labels: [self-hosted, doc-build]
needs:
- check-docs-typos
- check-docs-linter-formatter
steps:
- name: Get the latest document contents
run: |
Expand All @@ -34,7 +72,7 @@ jobs:
git pull >/dev/null
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
git checkout -qf FETCH_HEAD

- name: Check document changes
id: changed-doc-files
uses: tj-actions/changed-files@v46
Expand Down Expand Up @@ -88,3 +126,4 @@ jobs:
cd ${{ env.DOC_WKC }}/${{ env.EN_DOC_REPO }}
yarn ass localCloud
yarn build