From the course: Advanced GitHub Actions
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Matrix strategy overview - GitHub Tutorial
From the course: Advanced GitHub Actions
Matrix strategy overview
- [Instructor] Using a Matrix Strategy you can use one job to create a variety of different configurations. Your matrix is defined as a job configuration element using the strategy keyword followed by the matrix keyword. Any option in the matrix must have a key and one or more values in a list. In this example, we're creating a matrix with the key named version, and an array with the values 14, 16, and 17. We'll be able to reference these values in the workflow by using the matrix context, followed by the key. References to the matrix context can be made just about anywhere in a workflow, but they're particularly useful in the runs-on and uses contexts. In this example, we're using the setup node action which takes an input for the node version. Our matrix will use each of the values we specify in our matrix strategy to create a separate instance of our job. In other words, three different jobs will be created using…