Skip to content

Update Tweets

Update Tweets #90

Workflow file for this run

name: Update Tweets
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-tweets:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.4'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r server/requirements.txt
- name: Set up Chrome and ChromeDriver
uses: browser-actions/setup-chrome@v1
with:
chrome-version: '114.0.5735.198'
- name: Run scraping script
env:
TWITTER_USERNAME: ${{ secrets.TWITTER_USERNAME }}
TWITTER_PASSWORD: ${{ secrets.TWITTER_PASSWORD }}
run: |
python server/scrape_tweet.py
- name: Commit and push if changed
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add client/WaterCodes.json
git commit -m "Update tweets" || exit 0
git push