Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit e834fe8

Browse files
committed
[action]: run scapper and builder in gh action @ 1h;
1 parent fe7db42 commit e834fe8

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Run Builder and Scrapper Hourly
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *' # every hour
6+
7+
jobs:
8+
run-builder-scrapper:
9+
if: github.actor != 'github-actions[bot]'
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Install Deps
25+
run: npm i -g pnpm && pnpm install
26+
27+
- name: Run builder
28+
run: node app-builder.js
29+
30+
- name: Commit builder output
31+
run: |
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
git add .
35+
TIMESTAMP=$(TZ=Asia/Dhaka date '+%Y.%m.%d %H.%M GMT+6;')
36+
git commit -m "[builder][bot]: ran builder;" || echo "No changes to commit"
37+
38+
- name: Run scrapper
39+
run: node src/scrapper/index.js
40+
41+
- name: Commit scrapper output
42+
run: |
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git add .
46+
TIMESTAMP=$(TZ=Asia/Dhaka date '+%Y.%m.%d %H.%M GMT+6;')
47+
git commit -m "[dump][bot]: data dump at ${TIMESTAMP}" || echo "No changes to commit"
48+
49+
- name: Push changes
50+
run: git push

0 commit comments

Comments
 (0)