-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.77 KB
/
cron.yml
File metadata and controls
62 lines (51 loc) · 1.77 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
53
54
55
56
57
58
59
60
61
62
name: cron
on:
schedule:
- cron: '0,30 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
deploy-v2:
name: Deploy scraper ^5.0
runs-on: ubuntu-24.04
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
- name: Checkout Code
uses: actions/checkout@v5
- name: Install base dependencies (without scraper)
run: |
composer remove bvp/scraper --no-update || true
composer install --no-interaction --no-progress
- name: Require scraper version ^5.0
run: composer require bvp/scraper:^5.0 --no-update
- name: Update lock file for scraper
run: composer update bvp/scraper --with-dependencies
- name: Final install
run: composer install --prefer-dist --no-interaction --no-progress
- name: Scrape Data (v2)
run: php scraper.php v2
- name: Deploy JSON for scraper v2
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
FILES=$(
{
git ls-files -m -- 'docs/v2' | grep '\.json$'
git diff --cached --name-only --diff-filter=AM -- 'docs/v2' | grep '\.json$'
git ls-files --others --exclude-standard -- 'docs/v2' | grep '\.json$'
} | sort -u
)
if [ -n "$FILES" ]; then
git add $FILES
git commit -m "chore: deploy JSON files to docs/v2 [skip ci]" || exit 0
git pull --rebase --autostash
git push origin HEAD
else
echo "No JSON changes in docs/v2 to commit."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}