Run Selenium On GitHub Action #47142
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
name: Run Selenium On GitHub Action | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/20 * * * *' | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out repo | |
uses: actions/checkout@v3 | |
- name: Setting up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Installing package list | |
run: apt list --installed | |
- name: Removing previous chrome instances on runner | |
run: sudo apt purge google-chrome-stable && rm -rf youtube*.zip | |
# Need to fetch reqs if needed | |
- name: Installing all necessary packages | |
run: pip install chromedriver-autoinstaller selenium pyvirtualdisplay | |
- name: Install xvfb | |
run: sudo apt-get install xvfb | |
- name: Running the Python script | |
run: python Selenium-Template.py | |
#run: python Twitter.py | |
#run: python Selenium-Template.py | |
- name: Commit and Push The Results From Python Selenium Action | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git commit -m "GitHub Actions Results added" | |
git push |