From 96e9f42441b1c5b0dac742ee87272ee0aebc1331 Mon Sep 17 00:00:00 2001 From: Anuj Rawat <37796611+ajtazer@users.noreply.github.com> Date: Mon, 30 Sep 2024 00:56:05 +0530 Subject: [PATCH] using nanasess's Chromedriver workflow --- .github/workflows/python-app.yml | 49 +++++++++++--------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 63dc5a7..bad3a7a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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 }}