-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (40 loc) · 1.34 KB
/
Copy pathupdate_portfolio.yml
File metadata and controls
46 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update Portfolio Data
on:
schedule:
# Run every 15 minutes
- cron: '*/15 * * * *'
workflow_dispatch: # Allow manual trigger
jobs:
update-data:
runs-on: ubuntu-latest
permissions:
contents: write # Give the workflow write permissions to the repository
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: true # Ensure credentials are passed to later steps
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run update job
env:
ALPACA_API_KEY: ${{ secrets.ALPACA_API_KEY }}
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_SECRET_KEY }}
ALPACA_PAPER: ${{ secrets.ALPACA_PAPER || 'true' }}
run: |
cd dashboard/update_jobs
python positions_job.py
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "actions@github.com"
git pull --rebase
git add dashboard/data/snapshots/
git commit -m "Update portfolio data [skip ci]" || echo "No changes to commit"
git push