-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.14 KB
/
crawl.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
name: Crawl Data
on:
schedule:
- cron: '0 4 * * *' # Run daily at 12:00 PM UTC+8 (4:00 AM UTC)
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: crawl
cancel-in-progress: false
jobs:
crawl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Checkout to result branch
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout --orphan result
git pull origin result
git reset
- name: pnpm setup
uses: pnpm/action-setup@v3
with:
version: '9.1.2'
- name: Install node modules
run: pnpm install
- name: Crawl data
run: pnpm run crawldata
- name: Push to result branch
run: |
git add result/* -f
git commit -m "$(TZ=Asia/Shanghai date +"%Y-%m-%d %H:%M:%S")"
git push origin result