From the course: GitHub Actions for CI/CD: Build, Test, and Deploy

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Set up CI for JavaScript

Set up CI for JavaScript

In this lesson, I'll demonstrate using a starter workflow for a JavaScript project. I'm starting in a new repo where I've added the exercise files for this lesson. I'll create a workflow by selecting the Actions tab. Based on the code in the repo, GitHub is suggesting workflows for a JavaScript project. I'm not publishing a package, so I'll scroll down to the Continuous Integration section. Here's a workflow that sets up a simple CI pipeline for Node.js. So I'll use that one. This workflow has the sections we discussed in the previous lesson, steps to check out the code, an action that sets up Node.js for the target version, and then npm commands to build and test the project. This workflow also uses a matrix strategy with three node versions. This will run all of the build and test steps with each version of node in the list. For now, I'll accept everything here and commit this workflow. The trigger for pushes to the main branch will start a workflow run so I'll go to the actions…

Contents