4 GitHub Actions
This chapter covers the following topics:
- Types of actions
- Authoring actions
- Hands-on: my first Docker container action
- Sharing actions
- Advanced action development
Now that we have explored the YAML and workflow syntax in detail, this chapter will dive into the core building block of GitHub Actions – the reusable and sharable actions themselves that give the product its name.
The chapter will cover the different types of actions and some tips to get started writing your first actions. We will cover this in detail in a hands-on lab, where you can follow along step by step. Additionally, the chapter will cover sharing actions in the marketplace and internally, and some advanced topics for action authors.
4.1 Types of Actions
There are three different types of actions:
- Docker container actions
- JavaScript actions
- Composite actions
Docker container Actions only run on Linux whereas JavaScript and composite Actions can be used on any platforms.
All actions have in common, that they are defined by a file action.yml (or action.yaml) that contains the metadata for the action. This file cannot be named differently, meaning a action must reside in its own repository or folder. The run section in the action.yml file defines what type of action it is.