Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy LS Sensor on Environment

on:
deployment:

jobs:
deployment:
runs-on: [self-hosted, iot]
environment: Home

steps:

- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize Arduino CLI
run: |
& "$Env:RUNNER_TOOL_CACHE\arduino-cli\arduino-cli.exe" --config-file config.yaml core update-index

- name: Install required board core
run: |
& "$Env:RUNNER_TOOL_CACHE\arduino-cli\arduino-cli.exe" --config-file config.yaml core install arduino:avr

- name: Install custom Arduino libraries (Windows)
shell: powershell
run: |
& "$Env:RUNNER_TOOL_CACHE\arduino-cli\arduino-cli.exe" --config-file config.yaml lib install MQTTESP8266

- name: Set configs (Windows)
shell: powershell
run: |
$env:CONFIG_H | Out-File -Encoding ascii config.h
env:
CONFIG_H: ${{ secrets.CONFIG_H }}

- name: Compile Arduino project
run: |
& "$Env:RUNNER_TOOL_CACHE\arduino-cli\arduino-cli.exe" --config-file config.yaml compile --fqbn arduino:avr:uno ./ --output-dir build

- name: Upload firmware to Arduino
run: |
$port = "${{ github.event.deployment.payload.serial_port }}"
& "$Env:RUNNER_TOOL_CACHE\arduino-cli\arduino-cli.exe" --config-file config.yaml upload --fqbn arduino:avr:uno --port $port --input-dir build