github actions general

General

Workflows

– it runs one or more jobs.
– it is defined by a YAML file located in to your github repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
– a repository can have one or more workflows.
Each of which can perform a different set of jobs all the same but in a specific and environment.
– workflows yaml files are defined in the .github/workflows directory of the repository.
– a workflow can reference another workflow.

Events

– it is a specific event that triggers a workflow run.
For example: someone creates a pull request, opens an issue, or pushes a commit to a repository.
These are events triggered inside the repository.
– you can also generate an external event to trigger a workflow by posting to the REST API, or execute the workflow manually.

Jobs

– it is a set of steps in a workflow that is executed on the same runner.
– By default, jobs have no dependencies and run in parallel with each other.
– You can configure a job as dependent of other jobs.
When a job depends on another job, it will wait for the dependent job to complete before it can run.

Steps

– A step is:
* either a shell script that will be executed
* or an action that will be run.

– steps are executed in order and are dependent on each other.
– since each step is executed on the same runner, you can share data from one step to another.
For example, you can have a step that create some files (ex: build,tests execution…) followed by a step that use this files (ex: check the quality of the build, generate test reports).

Actions

– it is a custom addon/extension in GitHub Actions that performs a relatively complex but frequently repeated task.
– it helps reduce the duplication code that you write in your workflow files.
– An action can do many things such as: pull your git repository, set up your build environment or build your application.
– You can write your own actions, or use them available in the GitHub Marketplace.

Runners

– it is a server that runs your workflows when they’re triggered.
– each runner can run a single job at a time.
– GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners.

Expressions

An expression can be any combination of literal values, references to a context, or functions.
You can combine literals, context references, and functions using operators.
Syntax:
${{ <expression> }}
Example:
${{ github.actor }}

        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
  maven-test:
    if: false

Note: When you use expressions in an if conditional, you may omit the expression syntax.

Ce contenu a été publié dans Non classé. Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *