4 Commits

Author SHA1 Message Date
user
9ece83bac0 ci: Simplify deploy script to pure POSIX sh
All checks were successful
Lint & Build / C/C++ Static Analysis (push) Successful in 35s
Lint & Build / Security Flaw Analysis (push) Successful in 18s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m17s
Lint & Build / Deploy to ESP Fleet (push) Successful in 3m28s
2026-02-05 13:28:28 +01:00
user
cfa22e9e2a ci: Fix deploy script for POSIX sh, use explicit bash
Some checks failed
Lint & Build / C/C++ Static Analysis (push) Successful in 35s
Lint & Build / Security Flaw Analysis (push) Successful in 19s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m18s
Lint & Build / Deploy to ESP Fleet (push) Failing after 1m51s
2026-02-05 13:21:38 +01:00
user
baf2c69aee ci: Use hardcoded sensor IPs for deploy
Some checks failed
Lint & Build / C/C++ Static Analysis (push) Successful in 34s
Lint & Build / Security Flaw Analysis (push) Successful in 19s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Build Firmware (push) Successful in 2m17s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Deploy to ESP Fleet (push) Failing after 1m51s
2026-02-05 13:14:38 +01:00
user
7be795a26e ci: Fix deploy job - use container with host networking
All checks were successful
Lint & Build / C/C++ Static Analysis (push) Successful in 35s
Lint & Build / Security Flaw Analysis (push) Successful in 19s
Lint & Build / Secret Scanning (push) Successful in 4s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m16s
Lint & Build / Deploy to ESP Fleet (push) Successful in 1m53s
2026-02-05 12:29:22 +01:00

View File

@@ -54,51 +54,53 @@ jobs:
runs-on: anvil runs-on: anvil
needs: build needs: build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true' || startsWith(github.ref, 'refs/tags/v') 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
steps: steps:
- name: Install tools
run: |
apt-get update && apt-get install -y --no-install-recommends netcat-openbsd avahi-utils
- name: Checkout - name: Checkout
run: | run: |
git clone --depth=1 --branch=${{ github.ref_name }} \ git clone --depth=1 --branch=${{ github.ref_name }} \
https://oauth2:${{ github.token }}@git.mymx.me/${{ github.repository }}.git . https://oauth2:${{ github.token }}@git.mymx.me/${{ github.repository }}.git .
- name: Rebuild firmware for deploy - name: Build firmware
run: | run: |
podman run --rm -v $(pwd):/project -w /project docker.io/espressif/idf:v5.3 \ . /opt/esp/idf/export.sh
bash -c ". /opt/esp/idf/export.sh && cd get-started/csi_recv_router && idf.py build" cd get-started/csi_recv_router
idf.py build
- name: Deploy via OTA - name: Deploy via OTA
run: | run: |
FIRMWARE="$(pwd)/get-started/csi_recv_router/build/csi_recv_router.bin"
SENSORS="muddy-storm amber-maple hollow-acorn"
PORT=8070 PORT=8070
# Get runner IP (first non-loopback IPv4) # Get host IP
RUNNER_IP=$(hostname -I | awk '{print $1}') HOST_IP=$(hostname -I | awk '{print $1}')
echo "Runner IP: $RUNNER_IP" echo "Host IP: $HOST_IP"
# Start HTTP server in background # Start HTTP server in background
cd get-started/csi_recv_router/build cd get-started/csi_recv_router/build
python3 -m http.server $PORT & python3 -m http.server $PORT --bind 0.0.0.0 &
HTTP_PID=$! HTTP_PID=$!
sleep 2 sleep 2
# Deploy to each sensor # Deploy to muddy-storm
for sensor in $SENSORS; do echo "=== Deploying to muddy-storm (192.168.129.29) ==="
echo "=== Deploying to $sensor ===" echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.29 5501 || true
# Resolve mDNS hostname sleep 30
SENSOR_IP=$(getent hosts ${sensor}.local | awk '{print $1}' || avahi-resolve -n ${sensor}.local 2>/dev/null | awk '{print $2}')
if [ -z "$SENSOR_IP" ]; then
echo "Warning: Could not resolve $sensor.local, skipping"
continue
fi
echo "Sensor IP: $SENSOR_IP"
# Send OTA command via UDP # Deploy to amber-maple
echo "OTA http://${RUNNER_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 $SENSOR_IP 5501 echo "=== Deploying to amber-maple (192.168.129.30) ==="
echo "OTA command sent to $sensor" echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.30 5501 || true
sleep 30
# Wait for device to download and reboot # Deploy to hollow-acorn
sleep 30 echo "=== Deploying to hollow-acorn (192.168.129.31) ==="
done echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.31 5501 || true
sleep 30
# Cleanup # Cleanup
kill $HTTP_PID 2>/dev/null || true kill $HTTP_PID 2>/dev/null || true