Skip to content

Commit 1fe0ce9

Browse files
committed
feat: add deploy.yml
1 parent 84e683b commit 1fe0ce9

13 files changed

Lines changed: 356 additions & 281 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # 允许手动触发
8+
9+
# 设置 GITHUB_TOKEN 的权限
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# 只允许一个并发部署
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v2
35+
with:
36+
version: 8
37+
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
43+
44+
- name: Setup pnpm cache
45+
uses: actions/cache@v3
46+
with:
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-pnpm-store-
51+
52+
- name: Install dependencies
53+
run: pnpm install
54+
55+
- name: Build packages
56+
run: pnpm build
57+
58+
- name: Build site
59+
run: pnpm build:site
60+
61+
- name: Create .nojekyll for GitHub Pages
62+
run: touch packages/cosmic-web/dist/.nojekyll
63+
64+
- name: Upload artifact
65+
uses: actions/upload-pages-artifact@v3
66+
with:
67+
path: './packages/cosmic-web/dist'
68+
69+
deploy:
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-latest
74+
needs: build
75+
steps:
76+
- name: Deploy Documentation
77+
id: deployment
78+
uses: actions/deploy-pages@v4

.husky/commit-msg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
sh .git/hooks/commit-msg "$@"

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ pnpm build
8686
pnpm dev:site
8787
```
8888

89-
预览地址:http://localhost:8999/
90-
单组件预览地址:http://localhost:8999/components/cosmic/button
91-
单组件单个 Demo 预览地址:http://localhost:8999/components/cosmic/button/default?platform=mobile
89+
预览地址:http://localhost:5173/
90+
单组件预览地址:http://localhost:5173/components/cosmic/button
91+
单组件单个 Demo 预览地址:http://localhost:5173/components/cosmic/button/default?platform=mobile
9292

9393
说明:
9494
- `default` 代表 `button` 组件的 Demo 名字,对应 `src/button/doc/default.md`。Demo 名字由组件开发者自己决定。

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "cosmic",
2+
"name": "cosui",
33
"version": "1.2.0",
4-
"description": "",
4+
"description": "A frontend UI solution for the AI era. Includes UI protocols, rendering SDKs, and component libraries for Generative UI, AI Agents, and LLM-powered applications.",
55
"scripts": {
66
"clean": "pnpm -r clean",
77
"lint": "lint-staged",

packages/cosmic-web/src/theme/static/highlight.less

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,96 @@
77
*/
88

99
pre code {
10-
.cos-block();
11-
border: 1px solid #e9e9e9;
12-
border-radius: @border-radius-sm;
13-
padding: 16px 32px;
14-
font-size: @font-size-base;
15-
font-family: "Lucida Console", Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
16-
white-space: pre;
17-
color: @site-text-color;
18-
background: white;
19-
line-height: 2;
10+
.cos-block();
11+
border: 1px solid #e9e9e9;
12+
border-radius: @border-radius-sm;
13+
padding: 16px 32px;
14+
font-size: @font-size-base;
15+
font-family: "Lucida Console", Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
16+
white-space: pre;
17+
color: @site-text-color;
18+
background: white;
19+
line-height: 2;
2020
}
2121

2222
code[class*="language-"],
2323
pre[class*="language-"] {
24-
font-family: "Lucida Console", Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
25-
white-space: pre;
26-
color: black;
27-
background: none;
28-
direction: ltr;
29-
word-spacing: normal;
30-
word-break: normal;
31-
word-wrap: normal;
32-
line-height: 1.5;
33-
34-
-moz-tab-size: 4;
35-
-o-tab-size: 4;
36-
tab-size: 4;
37-
38-
-webkit-hyphens: none;
39-
-moz-hyphens: none;
40-
-ms-hyphens: none;
41-
hyphens: none;
42-
.cos-text-left();
24+
font-family: "Lucida Console", Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
25+
white-space: pre;
26+
color: black;
27+
background: none;
28+
direction: ltr;
29+
word-spacing: normal;
30+
word-break: normal;
31+
word-wrap: normal;
32+
line-height: 1.5;
33+
34+
-moz-tab-size: 4;
35+
-o-tab-size: 4;
36+
tab-size: 4;
37+
38+
-webkit-hyphens: none;
39+
-moz-hyphens: none;
40+
-ms-hyphens: none;
41+
hyphens: none;
42+
.cos-text-left();
4343
}
4444

4545
pre[class*="language-"]::-moz-selection,
4646
pre[class*="language-"] ::-moz-selection,
4747
code[class*="language-"]::-moz-selection,
4848
code[class*="language-"] ::-moz-selection {
49-
background: #b3d4fc;
50-
text-shadow: none;
49+
background: #b3d4fc;
50+
text-shadow: none;
5151
}
5252

5353
pre[class*="language-"]::selection,
5454
pre[class*="language-"] ::selection,
5555
code[class*="language-"]::selection,
5656
code[class*="language-"] ::selection {
57-
background: #b3d4fc;
58-
text-shadow: none;
57+
background: #b3d4fc;
58+
text-shadow: none;
5959
}
6060

6161
@media print {
62-
code[class*="language-"],
63-
pre[class*="language-"] {
64-
text-shadow: none;
65-
}
62+
code[class*="language-"],
63+
pre[class*="language-"] {
64+
text-shadow: none;
65+
}
6666
}
6767

6868
/* Code blocks */
6969
pre[class*="language-"] {
70-
overflow: auto;
71-
margin: 16px var(--cos-space-none);
72-
padding: var(--cos-space-sm) 20px;
70+
overflow: auto;
71+
margin: 16px var(--cos-space-none);
72+
padding: var(--cos-space-sm) 20px;
7373
}
7474

7575
:not(pre) > code[class*="language-"],
7676
pre[class*="language-"] {
77-
background: #f2f4f5;
77+
background: #f2f4f5;
7878
}
7979

8080
/* Inline code */
8181
:not(pre) > code[class*="language-"] {
82-
border-radius: .3em;
83-
padding: .1em;
84-
white-space: normal;
82+
border-radius: .3em;
83+
padding: .1em;
84+
white-space: normal;
8585
}
8686

8787
.token.comment,
8888
.token.prolog,
8989
.token.doctype,
9090
.token.cdata {
91-
color: slategray;
91+
color: slategray;
9292
}
9393

9494
.token.punctuation {
95-
color: #999;
95+
color: #999;
9696
}
9797

9898
.namespace {
99-
.cos-opacity-70();
99+
.cos-opacity-70();
100100
}
101101

102102
.token.property,
@@ -106,7 +106,7 @@ pre[class*="language-"] {
106106
.token.constant,
107107
.token.symbol,
108108
.token.deleted {
109-
color: #f81d22;
109+
color: #f81d22;
110110
}
111111

112112
.token.selector,
@@ -115,41 +115,41 @@ pre[class*="language-"] {
115115
.token.char,
116116
.token.builtin,
117117
.token.inserted {
118-
color: #0b8235;
118+
color: #0b8235;
119119
}
120120

121121
.token.operator,
122122
.token.entity,
123123
.token.url,
124124
.language-css .token.string,
125125
.style .token.string {
126-
color: #0b8235;
126+
color: #0b8235;
127127
}
128128

129129
.token.atrule,
130130
.token.attr-value,
131131
.token.keyword {
132-
color: #008dff;
132+
color: #008dff;
133133
}
134134

135135
.token.function {
136-
color: #f81d22;
136+
color: #f81d22;
137137
}
138138

139139
.token.regex,
140140
.token.important,
141141
.token.variable {
142-
color: #e90;
142+
color: #e90;
143143
}
144144

145145
.token.important,
146146
.token.bold {
147-
font-weight: bold;
147+
font-weight: bold;
148148
}
149149
.token.italic {
150-
font-style: italic;
150+
font-style: italic;
151151
}
152152

153153
.token.entity {
154-
cursor: help;
154+
cursor: help;
155155
}

0 commit comments

Comments
 (0)