name: Generate FX Radar Data on: workflow_dispatch: schedule: # every 30 mins from 08:00 to 16:30 London time - cron: '0,30 7-15 * * 1-5' # 17:00 London time - cron: '0 16 * * 1-5' # every 2 hours after that: 19:00, 21:00, 23:00 London time - cron: '0 18,20,22 * * 1-5' # overnight: 01:00, 03:00, 05:00, 07:00 London time - cron: '0 0,2,4,6 * * 2-6' 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: Sync with remote main run: | git fetch origin main git checkout main git reset --hard origin/main - name: Run data generation env: FRED_API_KEY: ${{ secrets.FRED_API_KEY }} FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }} GOV_API_KEY: ${{ secrets.GOV_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