Daily Trading Bot #43
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: Daily Trading Bot | |
| on: | |
| schedule: | |
| # Runs at 00:00 UTC (8:00 AM SGT) Tuesday-Saturday | |
| - cron: '0 0 * * 2-6' | |
| workflow_dispatch: | |
| jobs: | |
| run-trading-bot: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed if we want to commit changes (e.g. database updates, logs) | |
| env: | |
| TZ: Asia/Singapore | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Restore Data and Models Cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| data/ | |
| models/ | |
| model_registry.json | |
| key: ${{ runner.os }}-trading-bot-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-trading-bot- | |
| - name: Run Trading Bot | |
| env: | |
| SMTP_SERVER: ${{ secrets.SMTP_SERVER }} | |
| SMTP_PORT: ${{ secrets.SMTP_PORT }} | |
| SENDER_EMAIL: ${{ secrets.SENDER_EMAIL }} | |
| SENDER_PASSWORD: ${{ secrets.SENDER_PASSWORD }} | |
| RECIPIENT_EMAIL: ${{ secrets.RECIPIENT_EMAIL }} | |
| NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }} | |
| NVIDIA_API_KEY_ID: ${{ secrets.NVIDIA_API_KEY_ID }} | |
| NVIDIA_REASONING_API_KEY: ${{ secrets.NVIDIA_REASONING_API_KEY }} | |
| NVIDIA_REASONING_API_KEY_ID: ${{ secrets.NVIDIA_REASONING_API_KEY_ID }} | |
| TWELVEDATA_API_KEYS: ${{ secrets.TWELVEDATA_API_KEYS }} | |
| ARM_LIVE_TRADING: ${{ secrets.ARM_LIVE_TRADING }} | |
| LOG_LEVEL: ${{ secrets.LOG_LEVEL }} | |
| run: | | |
| python main.py daily_job | |
| - name: Upload artifacts (logs/reports) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bot-results | |
| path: | | |
| results/*.csv | |
| *.log | |
| retention-days: 7 | |
| - name: Save Data and Models Cache | |
| if: always() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| data/ | |
| models/ | |
| model_registry.json | |
| key: ${{ runner.os }}-trading-bot-${{ github.run_id }} |