Skip to content

Instantly share code, notes, and snippets.

@labouz
Created July 31, 2023 22:03
Show Gist options
  • Save labouz/3dd7231ddc4d649c21bcd7fdfcfae32a to your computer and use it in GitHub Desktop.
Save labouz/3dd7231ddc4d649c21bcd7fdfcfae32a to your computer and use it in GitHub Desktop.
gh actions config - data scrape and save data
name: run data scraper
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip pandas requests
pip install virtualenv
virtualenv env
source env/bin/activate
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Execute python script
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
run: |
python get_data.py
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "cron job: add data"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment