Files
FXandRatesDashboard/.github/workflows/update.yml
T
Tvishi AgarwalandGitHub 00178eb193 Update GitHub Actions workflow for data generation
Removed push trigger and added sync step before regenerating data.
2026-04-09 21:05:59 +01:00

63 lines
1.5 KiB
YAML

name: Generate FX Radar Data
on:
workflow_dispatch:
schedule:
- cron: '30 7 * * 1-5'
- cron: '0 12 * * 1-5'
- cron: '0 15 * * 1-5'
- cron: '30 20 * * 1-5'
permissions:
contents: write
concurrency:
group: fx-radar-data-main
cancel-in-progress: true
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run data generation
env:
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
run: python generate.py
- name: Sync with remote main
run: |
git fetch origin main
git checkout main
git reset --hard origin/main
- name: Regenerate data after sync
env:
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }}
run: python generate.py
- name: Commit and push data.json
run: |
git config user.name "FX Radar Bot"
git config user.email "bot@fxradar.app"
git add data.json
git diff --staged --quiet && exit 0
git commit -m "📊 Update market data $(date -u '+%Y-%m-%d %H:%M UTC')"
git push origin main