Overview
GitHub Actions est une plateforme d’intégration continue et livraison continue (CI/CD) qui vous permet d’automatiser votre pipeline de génération, de test et de déploiement. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.
GitHub Actions goes beyond just DevOps and lets you run workflows when other events happen in your repository. For example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository.
GitHub provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host your own self-hosted runners in your own data center or cloud infrastructure.
For more information about introducing GitHub Actions to your enterprise, see Introduction de GitHub Actions votre entreprise.
The components of GitHub Actions
You can configure a GitHub Actions workflow to be triggered when an event occurs in your repository, such as a pull request being opened or an issue being created. Your workflow contains one or more jobs which can run in sequential order or in parallel. Each job will run inside its own virtual machine runner, or inside a container, and has one or more steps that either run a script that you define or run an action, which is a reusable extension that can simplify your workflow.
Workflows
Un workflow est un processus automatisé configurable qui exécutera un ou plusieurs travaux. Les workflows sont définis par un fichier YAML archivé dans votre dépôt et s’exécutent lorsqu’ils sont déclenchés par un événement dans votre dépôt, ou ils peuvent être déclenchés manuellement ou selon une planification définie.
Les workflows sont définis dans l’annuaire .github/workflows
d’un dépôt. Un référentiel peut comporter plusieurs workflows, chacun d’entre eux pouvant effectuer un ensemble de tâches différentes, telles que :
- Construire et tester les demandes de tirage
- Déployer votre application à chaque fois qu'une version est créée
- Ajout d'une étiquette à chaque fois qu'un nouveau numéro est ouvert
You can reference a workflow within another workflow. For more information, see Reusing workflows.
For more information, see Writing workflows.
Events
An event is a specific activity in a repository that triggers a workflow run. For example, an activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow to run on a schedule, by posting to a REST API, or manually.
For a complete list of events that can be used to trigger workflows, see Events that trigger workflows.
Jobs
A job is a set of steps in a workflow that is executed on the same runner. Each 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 builds your application followed by a step that tests the application that was built.
You can configure a job's dependencies with other jobs; by default, jobs have no dependencies and run in parallel. When a job takes a dependency on another job, it waits for the dependent job to complete before running.
For example, you might configure multiple build jobs for different architectures without any job dependencies and a packaging job that depends on those builds. The build jobs run in parallel, and once they complete successfully, the packaging job runs.
For more information, see Choosing what your workflow does.
Actions
An action is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in your workflow files. An action can pull your Git repository from GitHub, set up the correct toolchain for your build environment, or set up the authentication to your cloud provider.
You can write your own actions, or you can find actions to use in your workflows in the GitHub Marketplace.
Pour partager des actions au sein de votre entreprise sans les publier publiquement, vous pouvez les stocker dans un référentiel interne, puis configurer celui-ci pour autoriser l’accès aux workflows GitHub Actions dans d’autres référentiels appartenant à la même organisation ou à toute autre organisation de l’entreprise. Pour plus d’informations, consultez « Sharing actions and workflows with your enterprise ».
For more information on actions, see Sharing automations.
Runners
A runner 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 to run your workflows. Each workflow run executes in a fresh, newly-provisioned virtual machine.
GitHub also offers exécuteur plus grands, which are available in larger configurations. For more information, see Using larger runners.
If you need a different operating system or require a specific hardware configuration, you can host your own runners.
For more information about self-hosted runners, see Hosting your own runners.
Next steps
GitHub Actions peut vous aider à automatiser presque tous les aspects de vos processus de développement d’applications. Vous êtes prêt à commencer ? Voici quelques ressources utiles pour effectuer vos étapes suivantes avec GitHub Actions :
- Pour créer un workflow GitHub Actions, consultez Using workflow templates.
- Pour connaître les workflows d’intégration continue (CI), consultez Building and testing.
- Pour générer et publier des packages, consultez Publishing packages.
- Pour le déploiement de projets, consultez Use cases and examples.
- Pour automatiser les tâches et les processus sur GitHub, consultez Managing projects.
- Pour obtenir des exemples illustrant des fonctionnalités plus complexes de GitHub Actions, consultez Use cases and examples. Ces exemples détaillés expliquent comment tester votre code sur un exécuteur et accéder à la CLI GitHub. Ils montrent également comment utiliser des fonctions avancées telles que la concurrence et les matrices de test.
- Pour certifier vos compétences en matière d’automatisation des workflows et d’accélération du développement avec GitHub Actions, obtenez un certificat GitHub Actions avec GitHub Certifications. Pour plus d’informations, consultez « À propos de GitHub Certifications ».