Intro to CI/CD Part 4: Continuous Deployment with GitHub Actions | Digi-Key Electronics



Intro to CI/CD Part 4: Continuous Deployment with GitHub Actions | Digi-Key Electronics

Intro to CI/CD Part 4: Continuous Deployment with GitHub Actions | Digi-Key Electronics

Continuous Integration and Continuous Delivery (CI/CD) is the process of automating the testing and deployment of a software project. It is often used in large-scale, multi-person projects, but it can be useful in smaller projects and embedded firmware development. This tutorial dives into continuous deployment, which is a logical next step in the continuous delivery process.

We demonstrate how to automatically build Raspberry Pi Pico firmware using Docker and GitHub Actions. The compiled binary is then hosted on a GitHub project releases page for end users to download and immediately flash to their boards.

You can view a written version of this tutorial here: https://www.digikey.com/en/maker/projects/continuous-deployment-using-docker-and-github-actions/d9d18e19361647dbb49070ce6f96c2ea

Code for this tutorial can be found here: https://github.com/ShawnHymel/pico-deployment-demo

Getting started with the Raspberry Pi Pico PDF: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

Previously, we looked at running modularized containers with Docker (https://www.youtube.com/watch?v=1nxGcfIm-TU) as well as building simple GitHub Actions workflows (https://www.youtube.com/watch?v=8pyqbYDYkRs). We will build on these concepts by creating an automated build process inside a Docker image.

Often, part of the CI/CD pipeline is to push compiled software to end users. This might include over-the-air updates to smartphones or operating systems, or it could refer to pushing a new version to servers for further testing or final integration (e.g. going live in production). However, this is often difficult in many embedded systems, as many microcontrollers do not include easy over-the-air updating capabilities. A decent substitute is to automatically generate a binary that users can simply flash to their microcontrollers.

The Raspberry Pi Pico build system is incredibly easy to set up on Linux, so we use that as a demonstration when writing a simple Dockerfile. The Docker image needs to install the entire toolchain and build the project. We then use a Docker command to copy out the compiled binary.

With GitHub Actions, we can automate the Docker build process so that the binary can be hosted on the GitHub project page. This allows users to download new versions of the software without needing to compile the project from source (and as a result, needing to install the toolchain themselves).

Product Links:
Raspberry Pi Pico – https://www.digikey.com/en/products/detail/raspberry-pi/SC0915/13624793

Related Videos:
Intro to CI/CD Part 1 – Getting Started with Docker: https://www.youtube.com/watch?v=1nxGcfIm-TU
Intro to CI/CD Part 2 – Getting Started with GitHub Actions: https://www.youtube.com/watch?v=8pyqbYDYkRs
Intro to CI/CD Part 3 – Getting Started with Unit Testing: https://www.youtube.com/watch?v=lZWFmEhIhpY

Related Project Links:
Getting Started with Docker – https://www.digikey.com/en/maker/projects/aa0d4c708c274ffd975f3b427e5c0ce6
Getting Started with GitHub Actions – https://www.digikey.com/en/maker/projects/getting-started-with-github-actions/078a1db505844a3ea9354bb0499973f4
Writing C/C++ Unit Tests with CppUTest – https://www.digikey.com/en/maker/projects/writing-cc-unit-tests-with-cpputest/7776121323b74ae7b207 5cf06163537

Related Articles:
How to Install and Get Started with Node-RED – https://www.digikey.com/en/maker/blogs/2022/how-to-install-and-get-started-with-node-red

Learn more:
Maker.io – https://www.digikey.com/en/maker Digi-Key’s Blog – TheCircuit https://www.digikey.com/en/blog Connect with Digi-Key on Facebook https://www.facebook.com/digikey.electronics/ And follow us on Twitter https://twitter.com/digikey

00:00 – Intro
00:29 – Overview of Continuous Deployment
04:00 – Create a Raspberry Pi Pico Blinky Program
08:13 – Use Docker to Build the Blinky Program
16:08 – Create a GitHub Actions Workflow to Build the Program
24:54 – Write the CHANGELOG and README
27:08 – Test Continuous Deployment with GitHub Actions
31:24 – Conclusion

Comments are closed.