Continuing my devops studies at MS Learn
Actions are the mechanism used to provide workflow automation within the GitHub environment.
They’re often used to build continuous integration (CI) and continuous deployment (CD) solutions.
However, they can be used for a wide variety of tasks:
- Automated testing.
- Automatically responding to new issues, mentions.
- Triggering code reviews.
- Handling pull requests.
- Branch management.
They’re defined in YAML and stay within GitHub repositories.
Actions are executed on “runners,” either hosted by GitHub or self-hosted.
Workflows
Workflows include several standard syntax elements.
- Name: is the name of the workflow. It’s optional but is highly recommended. It appears in several places within the GitHub UI.
- On: is the event or list of events that will trigger the workflow.
- Jobs: is the list of jobs to be executed. Workflows can contain one or more jobs.
- Runs-on: tells Actions which runner to use.
- Steps: It’s the list of steps for the job. Steps within a job execute on the same runner.
- Uses: tells Actions, which predefined action needs to be retrieved. For example, you might have an action that installs node.js.
- Run: tells the job to execute a command on the runner. For example, you might execute an NPM command.