-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (37 loc) · 1.06 KB
/
main.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
name: Daily Scrape
# Run the workflow daily
on:
schedule:
- cron: "0 * * * *"
permissions:
contents: write
jobs:
scrape_data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r src/scripts/requirements.txt # Assumes you have a requirements.txt file
- name: Run scraping script
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
source .venv/bin/activate
python src/scripts/snapshot_crawler.py
- name: Commit and push changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Add generated YAML files"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}