DEV Community

Doug Parsons
Doug Parsons

Posted on • Updated on

Noisy Build

UPDATE:

Congrats to all the winners of the Hackathon and thank you to the staff of dev.to for selecting my entry as a runner up! Looking forward to more events.

Noisy Build workflow

There are three main pieces to my entry:

  • Microsoft Azure IoT Hub - C2D Action - an action that publishes a message to an Azure IoT Hub
  • An MXCHIP IoT DevKit
  • A repository that contains a reference to the above action, the CI Workflow, and the C++ project that is running on the MXCHIP.

Submission Category: Interesting IoT (secondary would be Wacky Wildcards I suppose)

Yaml File or Link to Code

Microsoft Azure IoT Hub - C2D Action

This action allows you to send a Cloud-to-Device message as part of your Github Actions CI/CD workflow.

Basic Usage

- name: Publish Action C2D Message
  uses: dcparsons/azure-iot-action@v1.0.2
  with
    iot-hub-connection-string: <iot hub connection string&gt
    device-id: <device id&gt
    message: <message>

Parameters

  • iot-hub-connection-string - this should be the connection string to the IOT Hub that you setup in Microsoft Azure.
  • device-id - the id of the device you want to send a message to
  • message - the message you want to send to the device

Leveraging Secrets

Your IoT connection string is going to contain a shared access key which will grant anyone with the connection string access to your IoT Hub. If you are going to use this action in your CI/CD workflow I would highly suggest using GitHub Secrets to store that data. You can also choose to add your device-id as a secret…

2020 DEV.TO GitHub Actions Hackathon

This is my submission for the DEV.TO GitHub Actions Hackathon that I have named "Noisy Build". I entered this into the IoT category of the hackathon.

Summary

The premise of my entry is pretty simple: after a CI build completes, send a message to an Azure IoT Hub. That message is then relayed to a specific device (an MXChip IoT DevKit in my case) that interprets the message and plays a sound based on whether or not the build succeeded or failed.

The three main components of my entry follow.

  • /src/web-app - this is a vanilla dotnet API that was generated using dotnet new webapi. This is the code that the workflow will build and it is the result of this build that is sent to the IoT Hub.

  • /src/iot-app - this is an Ardunio C++ project that has been loaded onto the MXChip…

Additional Resources / Info

Here is a video that demonstrates the entire workflow.

Top comments (2)

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

Super Cooooool

Collapse
 
dcparsons profile image
Doug Parsons

Glad you liked it! Thanks!