-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (73 loc) · 2.27 KB
/
deploy.firmware.workflow.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Build Firmware and Upload .bin files to Hopping
on:
push:
branches:
- main
paths:
- "Blumy-Firmware/**"
- ".github/workflows/deploy.firmware.workflow.yml"
pull_request:
branches:
- main
paths:
- "Blumy-Firmware/**"
- ".github/workflows/deploy.firmware.workflow.yml"
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci
working-directory: Blumy-Firmware/frontend
- name: Build Frontend
run: npm run build
working-directory: Blumy-Firmware/frontend
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: frontend
path: Blumy-Firmware/main/index_html.c
build-firmware:
runs-on: ubuntu-latest
needs: build-frontend
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Frontend Artifact
uses: actions/download-artifact@v4
with:
name: frontend
path: Blumy-Firmware/main
- name: Build Firmware
run: |
docker run --rm -v $PWD:/project -w /project/Blumy-Firmware -u $UID -e HOME=/tmp espressif/idf idf.py build
- name: Rename Blumy-Firmware to firmware
run: mv Blumy-Firmware/build/Blumy-Firmware.bin Blumy-Firmware/build/firmware.bin
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: firmware
path: Blumy-Firmware/build/firmware.bin
deploy-firmware:
runs-on: ubuntu-latest
needs: build-firmware
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Firmware Artifact
uses: actions/download-artifact@v4
with:
name: firmware
path: firmware
- name: Upload Firmware Artifact
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.HOPPING_KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "firmware"
REMOTE_HOST: ${{ secrets.HOPPING_HOST }}
REMOTE_USER: ${{ secrets.HOPPING_USER }}
TARGET: ${{ secrets.HOPPING_HOST_PATH }}/api