-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (43 loc) · 1.12 KB
/
sync.yml
File metadata and controls
52 lines (43 loc) · 1.12 KB
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
name: Sync cc.storyfox.cz
on:
push:
branches:
- main
# 只在源码/配置变更时触发,避免生成物回推造成循环执行。
paths:
- '.github/workflows/sync.yml'
- 'scripts/**'
- 'data/config/**'
- 'templates/**'
- 'package.json'
- 'package-lock.json'
- 'script.js'
schedule:
- cron: '7 */11 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- name: Install deps
run: npm ci
- name: Run sync
run: npm run sync
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add index.html data/
git diff --cached --quiet || git commit -m "chore: auto sync cc quick page"
- name: Push changes
run: git push