Skip to content

Commit

Permalink
Create python-app.yml
Browse files Browse the repository at this point in the history
very fun
  • Loading branch information
ajtazer authored Sep 29, 2024
1 parent 3df123f commit ed832d1
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/python-app.yml
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

0 comments on commit ed832d1

Please sign in to comment.