-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (39 loc) · 1.41 KB
/
ota-update.yml
File metadata and controls
48 lines (39 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: ESP32 OTA update
on:
# push:
# branches:
# - 'master'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Connecting the GitHub workflow to Husarnet VPN network
uses: husarnet/husarnet-action@v2
with:
join-code: ${{ secrets.HUSARNET_JOIN_CODE }}
- name: ESP32 software reset
run: curl -X POST 'http://${{ secrets.HUSARNET_HOSTNAME }}:80/reset'
- name: Installing platformio
run: pip3 install -U platformio
- name: Building a firmware for ESP32
run: |
export SSID=${{ secrets.WIFI_SSID }}
export PASS=${{ secrets.WIFI_PASSWORD }}
export JOINCODE=${{ secrets.HUSARNET_JOIN_CODE }}
export HOSTNAME=${{ secrets.HUSARNET_HOSTNAME }}
pio lib install
pio run
- name: Uploading a firmware to ESP32
run: >
curl --http0.9 -# -v
-H 'Accept: */*'
-H 'Accept-Encoding: gzip, deflate'
-H 'Connection: keep-alive'
-F "MD5="$(md5sum "${{ github.workspace }}/.pio/build/esp32doit-devkit-v1/firmware.bin" | cut -d ' ' -f 1)""
-F 'firmware=@${{ github.workspace }}/.pio/build/esp32doit-devkit-v1/firmware.bin'
'http://${{ secrets.HUSARNET_HOSTNAME }}:80/update'
- name: Stop Husarnet
run: sudo systemctl stop husarnet