Skip to content

Commit

Permalink
chatgpt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiitsmocha committed Nov 23, 2024
1 parent 40fa7fc commit 0ce96c2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/test_scraper.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
name: Run Scraper Daily

# Set the schedule to run every 24 hours
# on:
# schedule:
# - cron: "0 0 * * *" # This runs at midnight UTC every day

#testing
# Set the schedule to run every 5 minutes
on:
push:
branches:
- scraper-tecq
branches:
- scraper-tecq
schedule:
- cron: "*/5 * * * *" # This runs every 5 minutes
workflow_dispatch: # This allows you to run the workflow manually
- cron: "*/5 * * * *" # Runs every 5 minutes
workflow_dispatch: # Allows manual workflow trigger

jobs:
run-scraper:
Expand All @@ -32,15 +25,25 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Chrome
# Setup Chrome and ChromeDriver
- name: Setup Chrome and ChromeDriver
uses: browser-actions/[email protected]
with:
chrome-version: 120
chrome-version: 120 # Match your target Chrome version
install-chromedriver: true

# Ensure CHROME_BIN and CHROMEDRIVER_PATH are exported
- name: Export Chrome and ChromeDriver Paths
run: |
echo "CHROME_BIN=/usr/bin/google-chrome" >> $GITHUB_ENV
echo "CHROMEDRIVER_PATH=$(which chromedriver)" >> $GITHUB_ENV
# Run the scraper
- name: Run Scraper
env:
CHROME_BIN: "/usr/bin/google-chrome" # Optional, in case your script needs the Chrome path
CHROMEDRIVER_PATH: "/opt/hostedtoolcache/setup-chrome/chromedriver/120.0.6099.109/x64"
CHROME_BIN: ${{ env.CHROME_BIN }} # Pass Chrome binary path to your script
CHROMEDRIVER_PATH: ${{ env.CHROMEDRIVER_PATH }} # Pass ChromeDriver path to your script
run: |
python main.py
Expand All @@ -59,7 +62,4 @@ jobs:
git commit -m "Add data for $timestamp"
git push --force
env:
# GitHub Token for permissions to push
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# make sure to push to scraper-tecq branch

0 comments on commit 0ce96c2

Please sign in to comment.