MQL5-Google-Onedrive/.github/workflows/deploy-cloud.yml
google-labs-jules[bot] fb5d048638 Bolt: Optimize EA performance and fix CI runner acquisition
MQL5 Optimizations:
- Consolidate trade counting and profit calculation into a single history scan in `UpdateDailyStatistics()`.
- Optimize `IsTradingAllowed()` with fast math for hour extraction, replacing expensive `TimeToStruct()`.
- Reduce terminal API calls in `CheckDailyLimits()` by caching account balance.
- Reuse `TimeCurrent()` value in `OnTick()` and pass to sub-functions.

CI Fixes:
- Transition all workflows from `ubuntu-latest` to `self-hosted` runners.
- This resolves the "Runner of type hosted not acquired" failure by utilizing the repository's configured self-hosted infrastructure.

Impact: Measurably faster execution in MT5 'hot paths' and restored CI/CD functionality.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-02-02 20:58:25 +00:00

69 行
2.2 KiB
YAML

name: Deploy to Cloud
on:
workflow_dispatch:
inputs:
platform:
description: 'Cloud platform to deploy to'
required: true
type: choice
options:
- render
- railway
- flyio
- docker
push:
branches:
- main
paths:
- 'scripts/**'
- 'config/**'
- 'Dockerfile'
- 'docker-compose.yml'
- '.github/workflows/deploy-cloud.yml'
permissions:
contents: read
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Validate deployment files
run: |
echo "Validating deployment configurations..."
test -f Dockerfile && echo "✅ Dockerfile found"
test -f docker-compose.yml && echo "✅ docker-compose.yml found"
test -f render.yaml && echo "✅ render.yaml found"
test -f railway.json && echo "✅ railway.json found"
test -f fly.toml && echo "✅ fly.toml found"
python scripts/deploy_cloud.py all
- name: Build Docker image
if: github.event.inputs.platform == 'docker' || github.event_name == 'push'
run: |
docker build -t mql5-automation:latest .
docker tag mql5-automation:latest mql5-automation:${{ github.sha }}
- name: Summary
run: |
echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Cloud deployment configurations validated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Available Platforms:" >> $GITHUB_STEP_SUMMARY
echo "- Render.com (render.yaml)" >> $GITHUB_STEP_SUMMARY
echo "- Railway.app (railway.json)" >> $GITHUB_STEP_SUMMARY
echo "- Fly.io (fly.toml)" >> $GITHUB_STEP_SUMMARY
echo "- Docker (Dockerfile)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "See [Cloud Deployment Guide](docs/Cloud_Deployment_Guide.md) for instructions." >> $GITHUB_STEP_SUMMARY