Make a workflow reusable, call it in another workflow, and use a matrix strategy to run multiple versions.
Reusable workflows offer a simple and powerful way to avoid copying and pasting workflows across your repositories, and adding a matrix strategy lets you use variables in a single job definition to automatically create multiple job runs.
- Who is this for: Developers, DevOps engineers, students, managers, teams, GitHub users.
- What you'll learn: How to create and use reusable workflows, create a matrix strategy, trigger workflows, and find workflow logs.
- What you'll build: An Actions workflow with a matrix strategy that calls a reusable workflow to output multiple verisions of node.
- Prerequisites: In this course you will work with pull requests and YAML workflow files. We recommend you take the Introduction to GitHub course first or be familiar with GitHub basics, and the Hello GitHub Actions course for an introduction to GitHub Actions and workflow files.
- How long: This course can be finished in less than one hour.
- Attribution: This Skills course was inspired by a demo video created by Mickey Gousset (@mickeygousset).
In this course, you will:
- Make a reusable workflow
- Add a job
- Add a matrix strategy
- Merge your pull request
- Trigger the workflow
- Right-click Start course and open the link in a new tab.
- In the new tab, most of the prompts will automatically fill in for you.
- For owner, choose your personal account or an organization to host the repository.
- We recommend creating a public repository, as private repositories will use Actions minutes.
- Scroll down and click the Create repository button at the bottom of the form.
- After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
Get help: Post in our discussion board • Review the GitHub status page
© 2023 GitHub • Code of Conduct • MIT License