Skip to content

Commit 5f4becc

Browse files
committed
ci: CD for auto deploy docs
1 parent 633463f commit 5f4becc

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed

.github/workflows/cd.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Docs CD
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4.0.0
21+
with:
22+
version: 9.7.0
23+
24+
- name: Use Node.js 20.x
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20.x
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Build esm
34+
run: pnpm build
35+
36+
- name: Install website dependencies
37+
run: cd website && pnpm install --frozen-lockfile
38+
39+
- name: Build website
40+
run: npm run prod
41+
42+
- name: Deploy gh-pages
43+
uses: JamesIves/github-pages-deploy-action@v4
44+
with:
45+
folder: docs

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export * from './monaco.contribution';
33
export * from './languageService';
44
export * from './setupLanguageFeatures';
55
export * from './common/constants';
6-
export * from './common/utils';
76
export * from './theme';
87

98
export { EntityContextType, StmtContextType } from 'dt-sql-parser';

website/src/extensions/workbench/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IEditorTab, IProblemsItem, MarkerSeverity } from '@dtinsight/molecule/e
99

1010
import { defaultLanguage, defaultEditorTab, defaultLanguageStatusItem, languages } from './common';
1111
import { LanguageService, ParseError } from 'monaco-sql-languages/esm/languageService';
12-
import { debounce } from 'monaco-sql-languages/esm/common/utils';
12+
import { debounce } from './utils';
1313

1414
export default class Sidebar extends React.Component {
1515
private _language = defaultLanguage;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export function debounce<T extends (...args: unknown[]) => unknown>(
2+
func: T,
3+
timeout: number,
4+
immediate?: boolean
5+
): (...args: Parameters<T>) => unknown {
6+
let timer: NodeJS.Timeout | null = null;
7+
return (...args) => {
8+
if (timer) {
9+
clearTimeout(timer);
10+
}
11+
if (immediate && !timer) {
12+
return func?.(...args);
13+
}
14+
15+
timer = setTimeout(() => {
16+
timer && clearTimeout(timer);
17+
timer = null;
18+
func?.(...args);
19+
}, timeout);
20+
};
21+
}

0 commit comments

Comments
 (0)