-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
very fun
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Python Selenium Scraper | ||
|
||
# Controls when the workflow will run | ||
on: | ||
push: | ||
branches: [ main ] # Trigger on push to the main branch | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Set up Python 3.9 environment | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
# Step 3: Install dependencies from requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
# Step 4: Download and set up ChromeDriver for Selenium | ||
- name: Set up ChromeDriver | ||
uses: browser-actions/setup-chromedriver@v1 | ||
with: | ||
chromedriver-version: 'latest' | ||
|
||
# Step 5: Install Google Chrome (required for headless Selenium) | ||
- name: Install Google Chrome | ||
uses: browser-actions/setup-chrome@v1 | ||
with: | ||
chrome-version: 'latest' | ||
|
||
# Step 6: Set the GOOGLE_SHEETS_CREDENTIALS environment variable from the secret | ||
- name: Set Google Sheets Credentials | ||
run: echo "GOOGLE_SHEETS_CREDENTIALS=$GOOGLE_SHEETS_CREDENTIALS" >> $GITHUB_ENV | ||
env: | ||
GOOGLE_SHEETS_CREDENTIALS: ${{ secrets.GOOGLE_SHEETS_CREDENTIALS }} | ||
|
||
# Step 7: Run the Python script | ||
- name: Run Python script | ||
run: | | ||
python main.py |