-
-
Notifications
You must be signed in to change notification settings - Fork 37
57 lines (48 loc) · 1.39 KB
/
webui-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "WebUI Build and Sync (Weekly, UTC)"
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
sync-webui:
runs-on: ubuntu-latest
steps:
- name: Checkout WebUI repo
uses: actions/checkout@v2
with:
ref: beta
repository: DoroWolf/akari-bot-webui
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js and install dependencies
uses: actions/setup-node@v3
with:
node-version: '16'
- run: |
npm install
npm run build
- name: Move dist to webui
run: |
mv dist webui
- name: Checkout Repo
uses: actions/checkout@v2
with:
repository: Teahouse-Studios/akari-bot
token: ${{ secrets.GITHUB_TOKEN }}
path: akari-bot
# 第五步:复制webui到仓库B的根目录
- name: Copy webui to akari-bot
run: |
cp -r webui akari-bot/
# 第六步:检查是否有变化
- name: Check for changes
run: |
cd akari-bot
git diff --exit-code || echo "Changes detected"
# 第七步:如果有变化,提交并推送
- name: Commit and push changes
run: |
cd akari-bot
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add .
git diff --quiet || (git commit -m "Sync WebUI [skip ci]" && git push)