Fix uploading blumy firmware #27
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: Build Firmware and Upload .bin files to Blumy | |
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.BLUMY_KEY }} | |
ARGS: "-rlgoDzvc -i" | |
SOURCE: "firmware" | |
REMOTE_HOST: ${{ secrets.BLUMY_HOST }} | |
REMOTE_USER: ${{ secrets.BLUMY_USER }} | |
TARGET: ${{ secrets.BLUMY_FIRMWARE_PATH }} |