-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.36 KB
/
Copy pathscrape.yml
File metadata and controls
56 lines (46 loc) · 1.36 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
name: scrape
on:
workflow_dispatch:
push:
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run scraper
env:
PYTHONUNBUFFERED: '1'
run: python scrape_ollama.py
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure git user
git config user.name "github-actions"
git config user.email "github-actions@github.com"
# Ensure remote uses GITHUB_TOKEN
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
# Stage changes
git add -A
# Commit and push if there are changes
if ! git diff --cached --quiet; then
git commit -m "✨ Data update at $(date -u '+%Y-%m-%d')"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi