diff --git a/.github/steps/1-make-workflow-reusable.md b/.github/steps/1-make-workflow-reusable.md index 0d491aa..45e5c2f 100644 --- a/.github/steps/1-make-workflow-reusable.md +++ b/.github/steps/1-make-workflow-reusable.md @@ -10,7 +10,7 @@ _Welcome to "Reusable Workflows and Matrix Strategies"! :wave:_ -You can do a lot with GitHub Actions! You can automate repetitive tasks, build continuous integration and continuous deployment pipelines, and customize essentially any part of your software development workflow. It doesn't matter if you're just learning about workflows and GitHub Actions for the first time or you're well exerpienced with the process, you'll quickly find yourself repeating automation jobs and steps within the same workflow, and even using the dreaded copy and paste method for workflows across multiple repositories. +You can do a lot with GitHub Actions! You can automate repetitive tasks, build continuous integration and continuous deployment pipelines, and customize essentially any part of your software development workflow. It doesn't matter if you're just learning about workflows and GitHub Actions for the first time or you're well experienced with the process, you'll quickly find yourself repeating automation jobs and steps within the same workflow, and even using the dreaded copy and paste method for workflows across multiple repositories. Is there a solution to reduce these repetitive tasks? Yes, I'm glad you asked :wink: Enter **reusable workflows**, a simple and powerful way to avoid copying and pasting workflows across your repositories. diff --git a/.github/steps/2-add-a-job.md b/.github/steps/2-add-a-job.md index ee746a8..0728e47 100644 --- a/.github/steps/2-add-a-job.md +++ b/.github/steps/2-add-a-job.md @@ -45,7 +45,7 @@ Okay, now that we know what the reusable workflow is doing, let's now add a new 1. Navigate to the `.github/workflows/` folder and open the `my-starter-workflow.yml` file. 1. Add a new job to the workflow called `call-reusable-workflow`. 1. Add a `uses` command and path the command to the `reusable-workflow.yml` file. -1. Add a `with` command to pass in a `node` paramater and set the value to `14`. +1. Add a `with` command to pass in a `node` parameter and set the value to `14`. ```yaml call-reusable-workflow: diff --git a/.github/steps/3-add-matrix-strategy.md b/.github/steps/3-add-matrix-strategy.md index 1c0a896..4b1142a 100644 --- a/.github/steps/3-add-matrix-strategy.md +++ b/.github/steps/3-add-matrix-strategy.md @@ -25,14 +25,14 @@ To define a matrix strategy inside a job, you first need to define the matrix wi The `example_matrix` job will run for each possible combination of the variables. So, in the above example, the workflow will run six jobs, one for each combination of the os and version variables. If you want to run a job for multiple versions, using a matrix strategy is a great solution over writing out 6 different jobs. -Let's add a matrix strategy to the **My Starter Workflow** so we can run our job on different versions of node instead of the hard-coded single verison of 14. +Let's add a matrix strategy to the **My Starter Workflow** so we can run our job on different versions of node instead of the hard-coded single version of 14. ### :keyboard: Activity: Use a matrix strategy to run multiple versions 1. In the same `my-starter-workflow.yml` file, add a `strategy` keyword under the `call-reusable-workflow` job. 1. Under `strategy`, add a `matrix` keyword. 1. Define the `nodeversion` variable to run over the following versions of node `[14, 16, 18, 20]`. -1. Replace the hard-coded `node` paramter of 14 used in the `with` command, and call the `nodeversion` in the matrix by using the following syntax `${{ matrix.nodeversion }}`. Below is that your job should look like: +1. Replace the hard-coded `node` parameter of 14 used in the `with` command, and call the `nodeversion` in the matrix by using the following syntax `${{ matrix.nodeversion }}`. Below is that your job should look like: ```yaml call-reusable-workflow: diff --git a/.github/steps/5-trigger-the-workflow.md b/.github/steps/5-trigger-the-workflow.md index 852c0af..e071bc2 100644 --- a/.github/steps/5-trigger-the-workflow.md +++ b/.github/steps/5-trigger-the-workflow.md @@ -8,7 +8,7 @@ _You're almost done. Last step! :heart:_ -Now that the changes have been merged into the `main` branch, let's trigger the **My Starter Workflow** workflow to see everyting in action! But before we do, let's recall what we should expect to see before we run the workflow. +Now that the changes have been merged into the `main` branch, let's trigger the **My Starter Workflow** workflow to see everything in action! But before we do, let's recall what we should expect to see before we run the workflow. - We should expect to see five jobs running from our \*My Starter Workflow\*\*. Do you remember which ones? We have the `build` job and then the `call-reusable-workflow` job that has the matrix strategy. ![Screen Shot 2022-09-08 at 9 53 52 AM](https://user-images.githubusercontent.com/6351798/189220189-97361a5e-eecf-4666-a859-e0587354bafe.png)