-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.4 KB
/
sync.yaml
File metadata and controls
48 lines (39 loc) · 1.4 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
name: Crawl and Sync Data
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
jobs:
crawl-and-sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Crawler Repository
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, json
- name: Update from repository
run: |
git config --global user.name "Max Base (Actions)"
git config --global user.email "maxbasecode+githubactions@gmail.com"
- name: Install Dependencies
run: composer install || echo "No composer.json found"
- name: Run Crawler Scripts
run: |
php download.php
php create-products.php
- name: Clone Data Repository
run: |
git clone https://github.com/BaseMax/buskool.com-data.git data-repo
rsync -av --delete data/ data-repo/data/
rsync -av --delete products/ data-repo/products/
cd data-repo
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/BaseMax/buskool.com-data.git data-repo
- name: Commit and Push Changes
run: |
cd data-repo
git add .
git commit -m "Update data and products from crawler run [${{ github.run_id }}]" || echo "No changes to commit"
git push origin main