Created
July 31, 2023 22:03
-
-
Save labouz/3dd7231ddc4d649c21bcd7fdfcfae32a to your computer and use it in GitHub Desktop.
gh actions config - data scrape and save data
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 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