Skip to content

Daily Portfolio Build #414

Daily Portfolio Build

Daily Portfolio Build #414

Workflow file for this run

name: Daily Portfolio Build
on:
schedule:
- cron: '0 22 * * 1-5' # Runs at 10:00 PM UTC Monday to Friday (5:00 PM EST or 6:00 PM EDT)
workflow_dispatch:
pull_request:
push:
branches: [ main ]
paths:
- 'config/portfolio_definitions/core.yaml'
- 'config/portfolio_definitions/benchmark.yaml'
permissions:
contents: write
concurrency:
group: daily-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build-portfolios:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.ACTIONS_GITHUB_PUSH_KEY }}
- name: Ensure latest changes (fast-forward only)
if: github.event_name != 'pull_request'
run: git pull --ff-only origin main
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Build portfolios
run: python scripts/build_all_portfolios.py
# TODO: change this to be more like a data migration than a complete rewrite
- name: Commit updated CSVs
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update portfolio CSVs [skip ci]"
file_pattern: data/*