DATEV Nine-Nine | A Fun and Simple CI/CD Setup with Cloudflare Workers and GitHub Actions Part 2

DATEV eG
DATEV TechBlog
Published in
3 min readOct 11, 2022

By: Matthias Alt, Stephan Bierwirth & Gerrit Riesch

Intro

In the first part we showed you how to set up Cloudflare Workers and how to deploy (manually) to Cloudflare. Of course, we want to automate the Deployment and therefore we add GitHub actions for a simple and free solution.

GitHub Actions

GitHub Actions are an easy way to build your own specific CI/CD pipeline. If you worked with GitLab-ci you can detect some similarities. Both scripts are written in a YAML file and use provided commands which abstract common tasks e.g., definition of the system environment (Linux, windows, etc.), checkout of the current repository, setup of the build environment (node, java, etc.). Further description of what is possible with GitHub Actions is provided in the following example.

Example

GitHub provides common build environments and package managers for the run scripts. Here you can find the official documentation of GitHub.

So, what does the pipeline actually do? The script will be triggered when we push commits on the main branch (1).

The jobs property describes the system environment setup (ubuntu-latest) the scripts runs on and the steps which can be written from top to bottom. Provided system runners by GitHub can be found here. Good to know: If you use any build specific run script e.g., npm, it will use the version which is provided by the system environment. But you can also define a specific version for e.g., Node, Java, Maven, etc.

So back to the steps. In the first step (2) we checkout our repository and then we run npm install (3). After these actions we describe a new step with a custom name. In this example we choose the name Publish (4) for the publishing step (no way sherlock). This step uses an action provided by GitHub for Cloudflare workers to publish your artifact (5). You need an API key as input parameter which you can get from the Cloudflare workers WebUI and store it in your GitHub repository secrets (6).

There are more GitHub actions for support of certain third-party services e.g., tools for Code Quality, Code Security, Notifications, Deployment etc. You can find everything in the marketplace. On the GitHub Docs website there is also a migration guide for common pipeline scripts such as Jenkins, TravisCi, Gitlab CI/CD, etc.

Final thoughts

GitHub actions are a simple way to set up a CI/CD pipeline for your project and are newbie friendly. We would like to know if you already used GitHub Actions to create your CI/CD pipeline for greater enterprise applications and what your experiences are. Please let us know by writing some phrases in the comment section so we can learn from each other or even better write your own blog to reach more people who are interested in this topic.

We hope you enjoyed our blog, and we would love to see you next time!

Your three DATEV Nine-Nine detectives,

Matthias Alt (LinkedIn)

Stephan Bierwirth (LinkedIn)

Gerrit Riesch (LinkedIn)

--

--

DATEV eG
DATEV TechBlog

DATEV eG steht für qualitativ hochwertige Softwarelösungen und IT-Dienstleistungen für Steuerberater, Wirtschaftsprüfer, Rechtsanwälte und Unternehmen.