ci: Run deploy on host with local HTTP server for OTA
All checks were successful
Lint & Build / Security Flaw Analysis (push) Successful in 16s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Successful in 28s
Lint & Build / Build Firmware (push) Successful in 1m53s
Lint & Build / Deploy to ESP Fleet (push) Has been skipped

This commit is contained in:
user
2026-02-05 23:23:45 +01:00
parent de3e120c7e
commit 9e3038e85f

View File

@@ -115,13 +115,8 @@ jobs:
runs-on: anvil
needs: [cppcheck, flawfinder, gitleaks]
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true' || startsWith(github.ref, 'refs/tags/v')
container:
image: docker.io/espressif/idf:v5.3
options: --network=host
# Run on host for local network access to sensors
steps:
- name: Install tools
run: apt-get update && apt-get install -y --no-install-recommends git curl jq netcat-openbsd
- name: Checkout
run: |
git clone --depth=1 --branch=${{ github.ref_name }} \
@@ -129,7 +124,7 @@ jobs:
- name: Build firmware
run: |
. /opt/esp/idf/export.sh
. $HOME/esp/esp-idf/export.sh
cd get-started/csi_recv_router
idf.py build
@@ -204,13 +199,23 @@ jobs:
run: |
SENSORS="muddy-storm:192.168.129.29 amber-maple:192.168.129.30 hollow-acorn:192.168.129.31"
EXPECTED_VERSION="${{ github.ref_name }}"
OTA_PORT=8899
# Use Gitea release URL (uploaded in previous step)
FIRMWARE_URL="https://git.mymx.me/${{ github.repository }}/releases/download/${{ github.ref_name }}/csi_recv_router.bin"
# Get host IP on local network
RUNNER_IP=$(ip route get 192.168.129.29 | grep -oP 'src \K[0-9.]+')
echo "Runner IP: $RUNNER_IP"
# Start local HTTP server
cd get-started/csi_recv_router/build
python3 -m http.server $OTA_PORT &
HTTP_PID=$!
sleep 2
FIRMWARE_URL="http://${RUNNER_IP}:${OTA_PORT}/csi_recv_router.bin"
echo "Firmware URL: $FIRMWARE_URL"
# Verify firmware is accessible
curl -sI "$FIRMWARE_URL" | head -1
# Verify server is running
curl -sI "http://localhost:${OTA_PORT}/csi_recv_router.bin" | head -1
# Deploy to all sensors in parallel
echo "=== Deploying to all sensors in parallel ==="
@@ -259,6 +264,9 @@ jobs:
fi
done
# Stop HTTP server
kill $HTTP_PID 2>/dev/null || true
# Final status
echo "=== Final sensor status ==="
for entry in $SENSORS; do