lfarci / github-actions

Preparation resources for the GitHub Actions certification
0 stars 0 forks source link

Identify the type of action required for a given problem (i.e. JavaScript, Docker container, run step) #48

Closed lfarci closed 4 months ago

lfarci commented 4 months ago

Types of actions

lfarci commented 4 months ago

Choosing the right type of GitHub Action for a given problem depends on the specific requirements of the task. Here are some guidelines:

  1. JavaScript Actions: JavaScript actions run directly on the runner machine, which makes them faster to start than Docker container actions. They are a good choice for most tasks, especially if the task involves interacting with the GitHub API or needs to work across all types of runners (Windows, Linux, and macOS).

  2. Docker Container Actions: Docker container actions run in a Docker container on the runner machine. They are a good choice if the task requires specific system dependencies that aren't available on the runner machine, or if you want to ensure a consistent environment regardless of the runner type. However, Docker container actions can only run on Linux runners.

  3. Run Step Actions: Run step actions are simple shell commands that are run directly on the runner machine. They are a good choice for simple tasks that can be accomplished with a single command or a short script.

Here are some examples:

Remember to consider the requirements of your task and the capabilities of each type of action when choosing the right action for your problem.