Skip to content

Commit a217231

Browse files
committed
CI config
1 parent 0267e4a commit a217231

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

.github/workflows/deploy-branch.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy Telegram KDoc Pages
2+
on:
3+
push:
4+
branches:
5+
- kdoc-deploy/*
6+
- kdoc-deploy/snapshots/*
7+
# - kdoc-deploy/component-telegram
8+
9+
jobs:
10+
# TG
11+
deploy-telegram-kdoc-pages:
12+
if: github.ref == 'refs/heads/kdoc-deploy/component-telegram'
13+
name: deploy-telegram-kdoc-pages
14+
runs-on: ubuntu-latest
15+
steps:
16+
# 检出仓库代码
17+
- uses: actions/checkout@v4
18+
19+
# https://github.com/marketplace/actions/github-pages-action
20+
- name: Deploy component/telegram to doc repository
21+
uses: peaceiris/actions-gh-pages@v3
22+
with:
23+
personal_token: ${{ secrets.PUSH_TOKEN }}
24+
publish_branch: gh-pages
25+
publish_dir: components/telegram
26+
destination_dir: components/telegram
27+
28+
deploy-telegram-snapshots-kdoc-pages:
29+
if: github.ref == 'refs/heads/kdoc-deploy/snapshots/component-telegram'
30+
name: deploy-telegram-snapshots-kdoc-pages
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Deploy snapshots/component/telegram to doc repository
35+
uses: peaceiris/actions-gh-pages@v3
36+
with:
37+
personal_token: ${{ secrets.PUSH_TOKEN }}
38+
publish_branch: gh-pages
39+
publish_dir: snapshots/components/telegram
40+
destination_dir: snapshots/components/telegram
41+
42+
# OneBot
43+
deploy-onebot-kdoc-pages:
44+
if: github.ref == 'refs/heads/kdoc-deploy/component-onebot'
45+
name: deploy-onebot-kdoc-pages
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Deploy component/onebot to doc repository
50+
uses: peaceiris/actions-gh-pages@v3
51+
with:
52+
personal_token: ${{ secrets.PUSH_TOKEN }}
53+
publish_branch: gh-pages
54+
publish_dir: components/onebot
55+
destination_dir: components/onebot
56+
57+
deploy-onebot-snapshots-kdoc-pages:
58+
if: github.ref == 'refs/heads/kdoc-deploy/snapshots/component-onebot'
59+
name: deploy-onebot-snapshots-kdoc-pages
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Deploy snapshots/component/onebot to doc repository
64+
uses: peaceiris/actions-gh-pages@v3
65+
with:
66+
personal_token: ${{ secrets.PUSH_TOKEN }}
67+
publish_branch: gh-pages
68+
publish_dir: snapshots/components/onebot
69+
destination_dir: snapshots/components/onebot

.github/workflows/index-page.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Deploy Index Page
22
on:
33
push:
4-
branches: 'doc-index'
4+
branches:
5+
- 'doc-index'
56
# Specify to run a workflow manually from the Actions tab on GitHub
67
workflow_dispatch:
78
jobs:
@@ -112,6 +113,18 @@ jobs:
112113
rm -rf kdoc/cp-tg
113114
working-directory: ./public
114115
116+
# OneBot
117+
- uses: actions/checkout@v4
118+
with:
119+
ref: 'kdoc-deploy/component-onebot'
120+
path: 'public/kdoc/cp-ob'
121+
122+
- run: |
123+
mkdir -p kdoc/cp-ob
124+
cp -r kdoc/cp-ob/* ./
125+
rm -rf kdoc/cp-ob
126+
working-directory: ./public
127+
115128
# snapshots
116129

117130
# main 快照
@@ -204,6 +217,18 @@ jobs:
204217
working-directory: ./public
205218
206219
220+
# OneBot快照
221+
- uses: actions/checkout@v4
222+
with:
223+
ref: 'kdoc-deploy/snapshots/component-onebot'
224+
path: 'public/kdoc/snapshots/cp-ob'
225+
226+
- run: |
227+
cp -r kdoc/snapshots/cp-ob/* ./
228+
rm -rf kdoc/snapshots/cp-ob
229+
working-directory: ./public
230+
231+
207232
- run: |
208233
npm ci
209234
npm run build

0 commit comments

Comments
 (0)