Skip to content

Update Data Workflow #6

Update Data Workflow

Update Data Workflow #6

name: Update Data Workflow
on:
schedule:
- cron: '0 10 * * *' # Run every day at 10:00 UTC
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11.8'
- name: Install dependencies
run: |
pip install pandas gspread oauth2client
- name: Write credentials to file
run: |
echo '${{ secrets.GOOGLE_CREDENTIALS }}' > omoku-analysis-cred_key.json
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Run the update script
run: python update_data.py
- name: Commit and push if changes
run: |
git config --global user.name 'Isaiah Akorita'
git config --global user.email '[email protected]'
git add -A
git commit -m "Automated data update" || echo "No changes to commit"
git push --set-upstream origin HEAD
env:
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: [email protected]
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]