ESP32 OTA update #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ESP32 OTA update | |
on: | |
# push: | |
# branches: | |
# - 'main' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Husarnet VPN | |
uses: husarnet/husarnet-action@v5 | |
with: | |
join-code: ${{ secrets.HUSARNET_JOINCODE }} | |
dashboard-login: ${{ secrets.HUSARNET_DASHBOARD_LOGIN }} | |
dashboard-password: ${{ secrets.HUSARNET_DASHBOARD_PASSWORD }} | |
- name: Wait until my-esp32 host is available | |
run: while ! grep -q "my-esp32" /etc/hosts; do sleep 1; done | |
- name: ESP32 software reset | |
run: curl -X POST 'http://my-esp32:8080/reset' | |
- name: Installing platformio | |
run: pip3 install -U platformio | |
- name: Building and uploading a firmware for ESP32 | |
run: | | |
export WIFI_SSID=${{ secrets.WIFI_SSID }} | |
export WIFI_PASS=${{ secrets.WIFI_PASS }} | |
export HUSARNET_JOINCODE=${{ secrets.HUSARNET_JOINCODE }} | |
pio run -e ota_upload --target upload | |
# - name: Uploading a firmware to ESP32 | |
# run: > | |
# curl --http0.9 -# -v | |
# --connect-timeout 30 | |
# --retry 5 | |
# --retry-delay 5 | |
# --retry-connrefused | |
# -H 'Accept: */*' | |
# -H 'Accept-Encoding: gzip, deflate' | |
# -H 'Connection: keep-alive' | |
# -F "MD5="$(md5sum "${{ github.workspace }}/.pio/build/esp32dev/firmware.bin" | cut -d ' ' -f 1)"" | |
# -F 'firmware=@${{ github.workspace }}/.pio/build/esp32dev/firmware.bin' | |
# 'http://my-esp32:8080/update' | |