Update Stock Data #45
This file contains hidden or 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: Update Stock Data | |
| on: | |
| schedule: | |
| # Run every weekday at 23:00 UTC (After US market close) | |
| - cron: '0 23 * * 1-5' | |
| # Allow manual trigger from GitHub Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| update-stocks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10.0' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r backend/requirements.txt | |
| - name: Run Update Script | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| run: | | |
| python scripts/update_database_stocks.py |