-
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.
using nanasess's Chromedriver workflow
- Loading branch information
Showing
1 changed file
with
17 additions
and
32 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 |
---|---|---|
@@ -1,51 +1,36 @@ | ||
name: Python Selenium Scraper | ||
name: SeeAyiii | ||
|
||
# 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 | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the repository | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Step 2: Set up Python 3.9 environment | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
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 | ||
uses: nanasess/setup-chromedriver@v2.2.2 | ||
with: | ||
chromedriver-version: 'latest' | ||
# Optional: Specify a version for ChromeDriver | ||
chromedriver-version: 'latest' # Or specify a specific version if needed | ||
|
||
# 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 }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# Step 7: Run the Python script | ||
- name: Run Python script | ||
- name: Run script | ||
run: | | ||
python main.py | ||
env: | ||
GOOGLE_SHEETS_CREDENTIALS: ${{ secrets.GOOGLE_SHEETS_CREDENTIALS }} |