Learn how to create reusable GitHub Actions workflows and call them from another workflow.
-
Who is this for: Developers and maintainers who want to reduce duplication in GitHub Actions pipelines.
-
What you'll learn: How to define and call reusable workflows, and how permissions flow across caller and nested reusable workflows.
-
What you'll build: A CI setup that runs reusable quality checks, deploys to GitHub Pages, and comments deployment details on pull requests.
-
Prerequisites:
- Basic familiarity with GitHub Actions workflows
- Recommended GitHub Skills exercises:
-
How long: This exercise takes less than an hour to complete.
In this exercise, you will:
- Create a reusable workflow from scratch and use it in another workflow.
- Deeply understand how permissions work across caller and reusable workflows.
- Expand your CI workflow to deploy to GitHub Pages and comment on pull requests with deployment details.
Simply copy the exercise to your account, then give your favorite Octocat (Mona) about 20 seconds to prepare the first lesson, then refresh the page.
Having trouble? 🤷
When copying the exercise, we recommend the following settings:
-
For owner, choose your personal account or an organization to host the repository.
-
We recommend creating a public repository, since private repositories will use Actions minutes.
If the exercise isn't ready in 20 seconds, please check the Actions tab.
-
Check to see if a job is running. Sometimes it simply takes a bit longer.
-
If the page shows a failed job, please submit an issue. Nice, you found a bug! 🐛