-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.37 KB
/
scrape.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
name: Hourly Scraping
on:
schedule:
- cron: "0 * * * *" # Runs every hour
push:
branches:
- main
workflow_dispatch: # Allows manual triggering
jobs:
run-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Run the scraper script for mortgage rates
run: bun run bin/scrape-mortgage-rates.ts
- name: Run the scraper script for personal loan rates
run: bun run bin/scrape-personal-loan-rates.ts
- name: Run the scraper script for car loan rates
run: bun run bin/scrape-car-loan-rates.ts
- name: Run the scraper script for credit card rates
run: bun run bin/scrape-credit-card-rates.ts
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Auto-commit changes at $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
git push