{"id":5246,"date":"2025-07-22T16:23:04","date_gmt":"2025-07-22T16:23:04","guid":{"rendered":"https:\/\/techhub.saworks.io\/docs\/tutoriel-github\/automatisez-votre-flux-de-travail-avec-github-actions-partie-1-sur-2\/comment-github-actions-automatise-t-il-les-taches-de-developpement\/"},"modified":"2025-07-31T13:17:03","modified_gmt":"2025-07-31T13:17:03","slug":"comment-github-actions-automatise-t-il-les-taches-de-developpement","status":"publish","type":"docs","link":"https:\/\/techhub.saworks.io\/fr\/docs\/tutoriel-github\/automatisez-votre-flux-de-travail-avec-github-actions-partie-1-sur-2\/comment-github-actions-automatise-t-il-les-taches-de-developpement\/","title":{"rendered":"Comment GitHub Actions automatise-t-il les t\u00e2ches de d\u00e9veloppement ?"},"content":{"rendered":"\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>Ici, nous pr\u00e9sentons GitHub Actions et les workflows.<\/p>\n\n\n\n<p>Vous allez d\u00e9couvrir les types d\u2019actions que vous pouvez utiliser et o\u00f9 les trouver. Vous verrez \u00e9galement des exemples de ces actions et comment elles s\u2019int\u00e8grent dans un workflow.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>GitHub r\u00e9duit le temps entre l\u2019id\u00e9e et le d\u00e9ploiement<\/strong><\/h3>\n\n\n\n<p>GitHub est con\u00e7u pour aider les \u00e9quipes de d\u00e9veloppeurs et d\u2019ing\u00e9nieurs DevOps \u00e0 cr\u00e9er et d\u00e9ployer des applications rapidement. De nombreuses fonctionnalit\u00e9s de GitHub permettent ces gains d\u2019efficacit\u00e9, qui se r\u00e9partissent g\u00e9n\u00e9ralement en deux grandes cat\u00e9gories :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Communication<\/strong>&nbsp;: GitHub facilite la collaboration entre les membres d\u2019une \u00e9quipe gr\u00e2ce aux revues de code dans les&nbsp;<em>pull requests<\/em>, aux&nbsp;<em>issues<\/em>, aux tableaux de projet, aux wikis, aux notifications, etc.<\/li>\n\n\n\n<li><strong>Automatisation<\/strong>&nbsp;: GitHub Actions permet \u00e0 votre \u00e9quipe d\u2019automatiser les workflows \u00e0 chaque \u00e9tape du processus de d\u00e9veloppement logiciel, de l\u2019int\u00e9gration \u00e0 la livraison, jusqu\u2019au d\u00e9ploiement. Il est m\u00eame possible d\u2019automatiser l\u2019ajout d\u2019\u00e9tiquettes aux&nbsp;<em>pull requests<\/em>&nbsp;ou la d\u00e9tection des&nbsp;<em>issues<\/em>&nbsp;obsol\u00e8tes.<\/li>\n<\/ul>\n\n\n\n<p>Combin\u00e9es, ces fonctionnalit\u00e9s ont permis \u00e0 des milliers d\u2019\u00e9quipes de d\u00e9veloppement de r\u00e9duire efficacement le temps entre l\u2019id\u00e9e initiale et le d\u00e9ploiement.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Utiliser l\u2019automatisation des workflows pour r\u00e9duire le temps de d\u00e9veloppement<\/strong><\/h3>\n\n\n\n<p>Dans ce module, nous nous concentrons sur l\u2019automatisation. Prenons un moment pour comprendre comment les \u00e9quipes peuvent utiliser l\u2019automatisation afin de r\u00e9duire le temps n\u00e9cessaire \u00e0 l\u2019ex\u00e9cution d\u2019un workflow de d\u00e9veloppement et de d\u00e9ploiement typique.<\/p>\n\n\n\n<p>Consid\u00e9rez toutes les t\u00e2ches \u00e0 effectuer apr\u00e8s l\u2019\u00e9criture du code, mais avant de pouvoir l\u2019utiliser de mani\u00e8re fiable. Selon les objectifs de votre organisation, vous devrez probablement :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>V\u00e9rifier que le code passe tous les tests unitaires.<\/li>\n\n\n\n<li>Effectuer des contr\u00f4les de qualit\u00e9 et de conformit\u00e9 pour s\u2019assurer que le code respecte les normes de l\u2019organisation.<\/li>\n\n\n\n<li>Analyser le code et ses d\u00e9pendances \u00e0 la recherche de failles de s\u00e9curit\u00e9 connues.<\/li>\n\n\n\n<li>Compiler le code en int\u00e9grant les contributions de plusieurs d\u00e9veloppeurs.<\/li>\n\n\n\n<li>V\u00e9rifier que le logiciel passe les tests d\u2019int\u00e9gration.<\/li>\n\n\n\n<li>D\u00e9finir la version de la nouvelle build.<\/li>\n\n\n\n<li>Livrer les nouveaux fichiers binaires \u00e0 l\u2019emplacement appropri\u00e9.<\/li>\n\n\n\n<li>D\u00e9ployer les binaires sur un ou plusieurs serveurs.<\/li>\n\n\n\n<li>Identifier les t\u00e2ches \u00e9chou\u00e9es et en informer la personne ou l\u2019\u00e9quipe concern\u00e9e.<\/li>\n<\/ul>\n\n\n\n<p>Le d\u00e9fi est d\u2019ex\u00e9cuter ces t\u00e2ches de mani\u00e8re fiable, coh\u00e9rente et durable. C\u2019est un cas id\u00e9al pour l\u2019automatisation des workflows. Si vous utilisez d\u00e9j\u00e0 GitHub, il est logique de configurer cette automatisation avec&nbsp;<strong>GitHub Actions<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Qu\u2019est-ce que GitHub Actions ?<\/strong><\/h3>\n\n\n\n<p>GitHub Actions sont des scripts packag\u00e9s permettant d\u2019automatiser des t\u00e2ches dans un workflow de d\u00e9veloppement logiciel sur GitHub. Vous pouvez configurer GitHub Actions pour d\u00e9clencher des workflows complexes adapt\u00e9s aux besoins de votre organisation. Le d\u00e9clencheur peut \u00eatre un&nbsp;<em>push<\/em>&nbsp;de code sur une branche, un intervalle de temps d\u00e9fini, ou une action manuelle. Le r\u00e9sultat est un workflow automatis\u00e9, fiable et durable, qui r\u00e9duit consid\u00e9rablement le temps de d\u00e9veloppement.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>O\u00f9 trouver les GitHub Actions ?<\/strong><\/h3>\n\n\n\n<p>Les GitHub Actions sont des scripts au format de donn\u00e9es&nbsp;<strong>YAML (.yml)<\/strong>. Chaque d\u00e9p\u00f4t GitHub poss\u00e8de un onglet&nbsp;<strong>Actions<\/strong>&nbsp;qui permet de d\u00e9marrer facilement la configuration de votre premier script. Si vous trouvez un workflow qui vous semble \u00eatre un bon point de d\u00e9part, cliquez simplement sur le bouton&nbsp;<strong>Configurer<\/strong>&nbsp;pour ajouter le script et commencer \u00e0 modifier le fichier source YAML.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"500\" data-src=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/07\/github-actions-automate-development-tasks-01-1-1024x500.png\" alt=\"\" class=\"wp-image-5251 lazyload\" data-srcset=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/07\/github-actions-automate-development-tasks-01-1-1024x500.png 1024w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/07\/github-actions-automate-development-tasks-01-1-300x147.png 300w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/07\/github-actions-automate-development-tasks-01-1-768x375.png 768w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/07\/github-actions-automate-development-tasks-01-1.png 1167w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/500;\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Au-del\u00e0 des GitHub Actions propos\u00e9es dans l\u2019onglet Actions, vous pouvez \u00e9galement :<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rechercher des GitHub Actions dans le GitHub Marketplace<\/strong>&nbsp;: Le Marketplace vous permet de d\u00e9couvrir et d\u2019acheter des outils qui \u00e9tendent vos workflows.<\/li>\n\n\n\n<li><strong>Explorer des projets open source<\/strong>&nbsp;: Par exemple, l\u2019organisation&nbsp;<em><a href=\"https:\/\/github.com\/actions\">GitHub Actions<\/a><\/em>&nbsp;propose de nombreux d\u00e9p\u00f4ts open source populaires contenant des actions que vous pouvez utiliser.<\/li>\n\n\n\n<li><strong>\u00c9crire vos propres GitHub Actions depuis z\u00e9ro<\/strong>&nbsp;: Vous pouvez les rendre open source ou m\u00eame les publier sur le GitHub Marketplace.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Utiliser des GitHub Actions open source<\/strong><\/h3>\n\n\n\n<p>De nombreuses GitHub Actions sont open source et disponibles pour tous. Cependant, comme pour tout logiciel open source, il est important de les examiner attentivement avant de les int\u00e9grer \u00e0 votre projet. Voici quelques bonnes pratiques \u00e0 suivre, similaires aux standards communautaires recommand\u00e9s pour les projets open source (README, code de conduite, fichier de contribution, mod\u00e8les d\u2019issues, etc.) :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Examiner le fichier&nbsp;<code>action.yml<\/code><\/strong>&nbsp;de l\u2019action pour comprendre les entr\u00e9es, les sorties, et v\u00e9rifier que le code fait bien ce qu\u2019il pr\u00e9tend faire.<\/li>\n\n\n\n<li><strong>V\u00e9rifier si l\u2019action est pr\u00e9sente sur le <a href=\"https:\/\/github.com\/marketplace?type=actions\">GitHub Marketplace<\/a><\/strong>&nbsp;: M\u00eame si ce n\u2019est pas obligatoire, cela peut \u00eatre un gage de qualit\u00e9.<\/li>\n\n\n\n<li><strong>V\u00e9rifier si l\u2019action est certifi\u00e9e sur le Marketplace<\/strong>&nbsp;: Une action v\u00e9rifi\u00e9e a \u00e9t\u00e9 approuv\u00e9e par GitHub, mais il est tout de m\u00eame recommand\u00e9 de la revoir avant utilisation.<\/li>\n\n\n\n<li><strong>Sp\u00e9cifier la version de l\u2019action utilis\u00e9e<\/strong>&nbsp;en indiquant une r\u00e9f\u00e9rence Git, un SHA ou un tag, pour garantir la stabilit\u00e9.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Types de GitHub Actions<\/strong><\/h3>\n\n\n\n<p>Il existe&nbsp;<strong>trois types<\/strong>&nbsp;de GitHub Actions :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Actions bas\u00e9es sur des conteneurs<\/strong>\n<ul class=\"wp-block-list\">\n<li>L\u2019environnement d\u2019ex\u00e9cution fait partie du code de l\u2019action.<\/li>\n\n\n\n<li>Ces actions ne peuvent \u00eatre ex\u00e9cut\u00e9es que dans un environnement&nbsp;<strong>Linux h\u00e9berg\u00e9 par GitHub<\/strong>.<\/li>\n\n\n\n<li>Elles prennent en charge de nombreux langages de programmation.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Actions JavaScript<\/strong>\n<ul class=\"wp-block-list\">\n<li>L\u2019environnement n\u2019est pas inclus dans le code.<\/li>\n\n\n\n<li>Vous devez sp\u00e9cifier l\u2019environnement d\u2019ex\u00e9cution.<\/li>\n\n\n\n<li>Ces actions peuvent \u00eatre ex\u00e9cut\u00e9es dans une machine virtuelle (VM) dans le cloud ou sur site.<\/li>\n\n\n\n<li>Compatibles avec&nbsp;<strong>Linux, macOS et Windows<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Actions composites<\/strong>\n<ul class=\"wp-block-list\">\n<li>Permettent de&nbsp;<strong>combiner plusieurs \u00e9tapes de workflow<\/strong>&nbsp;dans une seule action.<\/li>\n\n\n\n<li>Par exemple, vous pouvez regrouper plusieurs commandes&nbsp;<code>run<\/code>&nbsp;dans une action, puis ex\u00e9cuter ces commandes comme une seule \u00e9tape dans un workflow.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Anatomie d\u2019une GitHub Action<\/strong><\/h3>\n\n\n\n<p>Voici un exemple d\u2019action qui effectue un&nbsp;<strong>checkout Git<\/strong>&nbsp;d\u2019un d\u00e9p\u00f4t.<br>L\u2019action&nbsp;<code><a href=\"https:\/\/github.com\/actions\/checkout\">actions\/checkout@v1<\/a><\/code>&nbsp;fait partie d\u2019une \u00e9tape dans un workflow. Cette \u00e9tape compile \u00e9galement le code Node.js extrait du d\u00e9p\u00f4t.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#EEFFFF;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#212121\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>steps:\n  - uses: actions\/checkout@v1\n  - name: npm install and build webpack\n    run: |\n      npm install\n      npm run build<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-darker\" style=\"background-color: #212121\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">steps:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">uses:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">actions\/checkout@v1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">name:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">npm<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">install<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">and<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">build<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">webpack<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">run:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">|<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">npm<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">install<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">npm<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">run<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">build<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Supposons que vous souhaitiez utiliser une action bas\u00e9e sur un conteneur pour ex\u00e9cuter du code conteneuris\u00e9.<\/p>\n\n\n\n<p>Votre action pourrait ressembler \u00e0 ceci :<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#EEFFFF;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#212121\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>name: \"Hello Actions\"\ndescription: \"Greet someone\"\nauthor: \"octocat@github.com\"\n\ninputs:\n    MY_NAME:\n      description: \"Who to greet\"\n      required: true\n      default: \"World\"\n\nruns:\n    uses: \"docker\"\n    image: \"Dockerfile\"\n\nbranding:\n    icon: \"mic\"\n    color: \"purple\"<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-darker\" style=\"background-color: #212121\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">name:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Hello Actions<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">description:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Greet someone<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">author:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">octocat@github.com<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">inputs:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">MY_NAME:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">description:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Who to greet<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">required:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">default:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">World<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">runs:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">uses:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">docker<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">image:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Dockerfile<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">branding:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">icon:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">mic<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">color:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">purple<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Remarquez la section&nbsp;<code>inputs<\/code>.<\/strong><\/h3>\n\n\n\n<p>Ici, vous r\u00e9cup\u00e9rez la valeur d\u2019une variable appel\u00e9e&nbsp;<code>MY_NAME<\/code>. Cette variable est d\u00e9finie dans le workflow qui ex\u00e9cute cette action.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dans la section&nbsp;<code>runs<\/code>,<\/strong><\/h3>\n\n\n\n<p>vous sp\u00e9cifiez&nbsp;<code>docker<\/code>&nbsp;dans l\u2019attribut&nbsp;<code>uses<\/code>. Lorsque vous d\u00e9finissez cette valeur, vous devez fournir le chemin vers le fichier de l\u2019image Docker \u2014 dans ce cas,&nbsp;<code>Dockerfile<\/code>.<br>Nous n\u2019entrons pas ici dans les d\u00e9tails de Docker, mais si vous souhaitez en savoir plus, consultez le module&nbsp;<strong>Introduction aux conteneurs Docker<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>La derni\u00e8re section,&nbsp;<code>branding<\/code>,<\/strong><\/h3>\n\n\n\n<p>personnalise votre action dans le GitHub Marketplace si vous d\u00e9cidez de la publier.<\/p>\n\n\n\n<p>Vous pouvez consulter la liste compl\u00e8te des m\u00e9tadonn\u00e9es d\u2019une action dans la documentation :&nbsp;<a href=\"https:\/\/docs.github.com\/fr\/actions\/reference\/metadata-syntax-reference\"><strong>Syntaxe des m\u00e9tadonn\u00e9es pour GitHub Actions<\/strong>.<\/a><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Qu\u2019est-ce qu\u2019un workflow GitHub Actions ?<\/strong><\/h3>\n\n\n\n<p>Un&nbsp;<strong>workflow GitHub Actions<\/strong>&nbsp;est un processus que vous configurez dans votre d\u00e9p\u00f4t pour automatiser les t\u00e2ches du cycle de vie du d\u00e9veloppement logiciel, y compris l\u2019ex\u00e9cution d\u2019actions GitHub.<br>Avec un workflow, vous pouvez&nbsp;<strong>compiler, tester, empaqueter, publier et d\u00e9ployer<\/strong>&nbsp;n\u2019importe quel projet sur GitHub.<\/p>\n\n\n\n<p>Pour cr\u00e9er un workflow, vous ajoutez des actions dans un fichier&nbsp;<code>.yml<\/code>&nbsp;situ\u00e9 dans le r\u00e9pertoire&nbsp;<code>.github\/workflows<\/code>&nbsp;de votre d\u00e9p\u00f4t GitHub.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dans l\u2019exercice \u00e0 venir, votre fichier de workflow&nbsp;<code>main.yml<\/code>&nbsp;ressemblera \u00e0 cet exemple :<\/strong><\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#EEFFFF;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#212121\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>name: A workflow for my Hello World file\non: push\njobs:\n  build:\n    name: Hello world action\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions\/checkout@v1\n    - uses: .\/action-a\n      with:\n        MY_NAME: \"Mona\"<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-darker\" style=\"background-color: #212121\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">name:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">A<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">workflow<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">for<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">my<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">Hello<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">World<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">file<\/span><\/span>\n<span class=\"line\"><span style=\"color: #FFCB6B\">on:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">push<\/span><\/span>\n<span class=\"line\"><span style=\"color: #82AAFF\">jobs<\/span><span style=\"color: #EEFFFF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">build:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">name:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">Hello<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">world<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">action<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">runs-on:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">ubuntu-latest<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">steps:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">uses:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">actions\/checkout@v1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">uses:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">.\/action-a<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">with:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">        <\/span><span style=\"color: #FFCB6B\">MY_NAME:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">Mona<\/span><span style=\"color: #89DDFF\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Remarquez l\u2019attribut&nbsp;<code>on:<\/code><\/strong><\/h3>\n\n\n\n<p>Sa valeur est un&nbsp;<strong>d\u00e9clencheur<\/strong>&nbsp;qui sp\u00e9cifie&nbsp;<strong>quand<\/strong>&nbsp;ce workflow doit s\u2019ex\u00e9cuter.<br>Dans cet exemple, il est d\u00e9clench\u00e9 lorsqu\u2019un \u00e9v\u00e9nement de type&nbsp;<strong>push<\/strong>&nbsp;se produit sur votre d\u00e9p\u00f4t.<\/p>\n\n\n\n<p>Vous pouvez sp\u00e9cifier :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>un&nbsp;<strong>\u00e9v\u00e9nement unique<\/strong>&nbsp;comme&nbsp;<code>on: push<\/code>,<\/li>\n\n\n\n<li>un&nbsp;<strong>tableau d\u2019\u00e9v\u00e9nements<\/strong>&nbsp;comme&nbsp;<code>on: [push, pull_request]<\/code>,<\/li>\n\n\n\n<li>ou une&nbsp;<strong>carte de configuration d\u2019\u00e9v\u00e9nements<\/strong>&nbsp;(<em>event-configuration map<\/em>) qui permet de planifier un workflow ou de restreindre son ex\u00e9cution \u00e0 certains fichiers, balises (<em>tags<\/em>) ou modifications de branches.<\/li>\n<\/ul>\n\n\n\n<p>Une carte de configuration pourrait ressembler \u00e0 ceci :<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#EEFFFF;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#212121\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>on:\n  # Trigger the workflow on push or pull request,\n  # but only for the main branch\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n  # Also trigger on page_build, as well as release created events\n  page_build:\n  release:\n    types: # This configuration doesn't affect the page_build event above\n      - created<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-darker\" style=\"background-color: #212121\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #FFCB6B\">on:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #545454; font-style: italic\"># Trigger the workflow on push or pull request,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #545454; font-style: italic\"># but only for the main branch<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">push:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">branches:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">main<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">pull_request:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">branches:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">main<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #545454; font-style: italic\"># Also trigger on page_build, as well as release created events<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">page_build:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">release:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">types:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #545454; font-style: italic\"># This configuration doesn&#39;t affect the page_build event above<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">created<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Un \u00e9v\u00e9nement d\u00e9clenche toutes les activit\u00e9s associ\u00e9es, sauf si vous sp\u00e9cifiez un ou plusieurs types d\u2019activit\u00e9s.<\/p>\n\n\n\n<p>Pour une liste compl\u00e8te des \u00e9v\u00e9nements et de leurs types d\u2019activit\u00e9s, consultez la documentation GitHub :&nbsp;<a href=\"https:\/\/docs.github.com\/fr\/actions\/reference\/events-that-trigger-workflows\"><strong>\u00c9v\u00e9nements qui d\u00e9clenchent des workflows<\/strong>.<\/a><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Un workflow doit contenir au moins un job. Un&nbsp;<strong>job<\/strong>&nbsp;est une section du workflow associ\u00e9e \u00e0 un&nbsp;<strong>runner<\/strong>.<br>Un runner peut \u00eatre&nbsp;<strong>h\u00e9berg\u00e9 par GitHub<\/strong>&nbsp;ou&nbsp;<strong>auto-h\u00e9berg\u00e9<\/strong>, et le job peut s\u2019ex\u00e9cuter sur une machine ou dans un conteneur. Vous sp\u00e9cifiez le runner avec l\u2019attribut&nbsp;<code>runs-on:<\/code>.<br>Dans cet exemple, vous indiquez que le job doit s\u2019ex\u00e9cuter sur&nbsp;<code>ubuntu-latest<\/code>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Chaque job contient des \u00e9tapes (steps) \u00e0 ex\u00e9cuter. Dans notre exemple, l\u2019\u00e9tape utilise l\u2019action&nbsp;<code>actions\/checkout@v1<\/code>&nbsp;pour effectuer un&nbsp;<strong>checkout<\/strong>&nbsp;du d\u00e9p\u00f4t.<br>Ce qui est int\u00e9ressant ici, c\u2019est la valeur&nbsp;<code>uses: .\/action-a<\/code>, qui correspond au&nbsp;<strong>chemin vers l\u2019action conteneuris\u00e9e<\/strong>&nbsp;que vous avez d\u00e9finie dans un fichier&nbsp;<code>action.yml<\/code>.<\/p>\n\n\n\n<p>La derni\u00e8re partie de ce fichier de workflow d\u00e9finit la variable&nbsp;<code>MY_NAME<\/code>&nbsp;pour ce workflow.<br>Rappelez-vous que l\u2019action conteneuris\u00e9e attendait une entr\u00e9e appel\u00e9e&nbsp;<code>MY_NAME<\/code>.<\/p>\n\n\n\n<p>Pour plus d\u2019informations sur la syntaxe des workflows, consultez :&nbsp;<a href=\"https:\/\/docs.github.com\/fr\/actions\/reference\/workflow-syntax-for-github-actions\"><strong>Syntaxe des workflows pour GitHub Actions<\/strong>.<\/a><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Runners GitHub h\u00e9berg\u00e9s vs auto-h\u00e9berg\u00e9s<\/strong><\/h3>\n\n\n\n<p>Nous avons bri\u00e8vement mentionn\u00e9 que les&nbsp;<strong>runners<\/strong>&nbsp;sont associ\u00e9s \u00e0 un job.<br>Un runner est simplement un&nbsp;<strong>serveur<\/strong>&nbsp;sur lequel l\u2019application GitHub Actions Runner est install\u00e9e.<\/p>\n\n\n\n<p>Dans l\u2019exemple pr\u00e9c\u00e9dent, l\u2019attribut&nbsp;<code>runs-on: ubuntu-latest<\/code>&nbsp;indique que le job s\u2019ex\u00e9cutera sur un&nbsp;<strong>runner GitHub h\u00e9berg\u00e9<\/strong>&nbsp;dans un environnement Ubuntu \u00e0 jour.<\/p>\n\n\n\n<p>Il existe&nbsp;<strong>deux types de runners<\/strong>&nbsp;:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Runners GitHub h\u00e9berg\u00e9s<\/strong>&nbsp;: chaque job s\u2019ex\u00e9cute dans une instance propre d\u2019un environnement virtuel. Vous sp\u00e9cifiez l\u2019environnement avec&nbsp;<code>runs-on: {syst\u00e8me d\u2019exploitation-version}<\/code>.<\/li>\n\n\n\n<li><strong>Runners auto-h\u00e9berg\u00e9s<\/strong>&nbsp;: vous devez sp\u00e9cifier le label&nbsp;<code>self-hosted<\/code>, le syst\u00e8me d\u2019exploitation et l\u2019architecture.<br>Par exemple, un runner auto-h\u00e9berg\u00e9 sous Linux avec une architecture ARM32 se sp\u00e9cifie ainsi :<br><code>runs-on: [self-hosted, linux, ARM32]<\/code>.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Avantages des diff\u00e9rents types de runners<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Les&nbsp;<strong>runners GitHub h\u00e9berg\u00e9s<\/strong>&nbsp;sont plus simples et rapides \u00e0 utiliser, mais avec des options limit\u00e9es.<\/li>\n\n\n\n<li>Les&nbsp;<strong>runners auto-h\u00e9berg\u00e9s<\/strong>&nbsp;sont hautement configurables et peuvent \u00eatre ex\u00e9cut\u00e9s sur site ou dans le cloud.<br>Ils permettent :\n<ul class=\"wp-block-list\">\n<li>d\u2019utiliser du mat\u00e9riel personnalis\u00e9 (plus de puissance ou de m\u00e9moire),<\/li>\n\n\n\n<li>d\u2019installer des logiciels sp\u00e9cifiques \u00e0 votre r\u00e9seau local,<\/li>\n\n\n\n<li>de choisir un syst\u00e8me d\u2019exploitation non propos\u00e9 par GitHub.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>GitHub Actions a des limites d\u2019utilisation<\/strong><\/h3>\n\n\n\n<p>GitHub Actions impose certaines&nbsp;<strong>limites d\u2019utilisation<\/strong>, selon votre plan GitHub et le type de runner utilis\u00e9 (h\u00e9berg\u00e9 ou auto-h\u00e9berg\u00e9).<br>Pour plus d\u2019informations, consultez :&nbsp;<strong><a href=\"https:\/\/docs.github.com\/fr\/actions\/concepts\/billing-and-usage\">Limites d\u2019utilisation, facturation et administration<\/a><\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Runners GitHub h\u00e9berg\u00e9s de grande capacit\u00e9<\/strong><\/h3>\n\n\n\n<p>GitHub propose des&nbsp;<strong>runners plus puissants<\/strong>&nbsp;pour les workflows n\u00e9cessitant davantage de ressources.<br>Ces runners offrent plus de&nbsp;<strong>CPU, de m\u00e9moire et d\u2019espace disque<\/strong>&nbsp;que les runners standards.<\/p>\n\n\n\n<p>Ils sont con\u00e7us pour ex\u00e9cuter efficacement des workflows intensifs, comme :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compilation de grandes bases de code<\/li>\n\n\n\n<li>Ex\u00e9cution de suites de tests compl\u00e8tes (int\u00e9gration, end-to-end)<\/li>\n\n\n\n<li>Traitement de grands ensembles de donn\u00e9es (analyse, machine learning)<\/li>\n\n\n\n<li>Construction d\u2019applications avec de nombreuses d\u00e9pendances<\/li>\n\n\n\n<li>Simulations haute performance ou mod\u00e9lisation computationnelle<\/li>\n\n\n\n<li>Encodage vid\u00e9o, rendu ou traitement multim\u00e9dia<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Taille et \u00e9tiquettes des runners<\/strong><\/h3>\n\n\n\n<p>Les runners de grande capacit\u00e9 sont disponibles en plusieurs configurations (vCPU, RAM, SSD).<br>Pour les utiliser, sp\u00e9cifiez l\u2019\u00e9tiquette du runner dans l\u2019attribut&nbsp;<code>runs-on<\/code>&nbsp;de votre fichier workflow.<\/p>\n\n\n\n<p><strong>Exemple<\/strong>&nbsp;: pour utiliser un runner avec&nbsp;<strong>16 vCPU et 64 Go de RAM<\/strong>, indiquez :<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#EEFFFF;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#212121\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#EEFFFF;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>jobs:\n  build:\n    runs-on: ubuntu-latest-16core\n    steps:\n      - uses: actions\/checkout@v2\n      - name: Build project\n        run: make build<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-darker\" style=\"background-color: #212121\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #82AAFF\">jobs<\/span><span style=\"color: #EEFFFF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">  <\/span><span style=\"color: #FFCB6B\">build:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">runs-on:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">ubuntu-latest-16core<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">    <\/span><span style=\"color: #FFCB6B\">steps:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">uses:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">actions\/checkout@v2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">      <\/span><span style=\"color: #FFCB6B\">-<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">name:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">Build<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">project<\/span><\/span>\n<span class=\"line\"><span style=\"color: #EEFFFF\">        <\/span><span style=\"color: #FFCB6B\">run:<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">make<\/span><span style=\"color: #EEFFFF\"> <\/span><span style=\"color: #C3E88D\">build<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Ces ex\u00e9cuteurs plus grands maintiennent la compatibilit\u00e9 avec les workflows existants<\/p>\n\n\n\n<p>Ils incluent les&nbsp;<strong>m\u00eames outils pr\u00e9install\u00e9s<\/strong>&nbsp;que les ex\u00e9cuteurs standards&nbsp;<code>ubuntu-latest<\/code>.<\/p>\n\n\n\n<p>Pour plus d\u2019informations sur la taille des ex\u00e9cuteurs pour les ex\u00e9cuteurs plus grands, consultez la&nbsp;<a href=\"https:\/\/docs.github.com\/en\/actions\/using-github-hosted-runners\/using-larger-runners\/about-larger-runners#machine-sizes-for-larger-runners\">documentation GitHub<\/a><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>G\u00e9rer les ex\u00e9cuteurs plus puissants<\/strong><\/h3>\n\n\n\n<p>GitHub fournit des outils pour&nbsp;<strong>g\u00e9rer efficacement les ex\u00e9cuteurs plus volumineux<\/strong>, garantissant une utilisation optimale des ressources et une bonne gestion des co\u00fbts. Voici quelques aspects cl\u00e9s de cette gestion :<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Surveillance de l\u2019utilisation<\/strong><\/h3>\n\n\n\n<p>Vous pouvez surveiller l\u2019utilisation des ex\u00e9cuteurs plus puissants via la&nbsp;<strong>page d\u2019utilisation GitHub Actions<\/strong>&nbsp;dans les param\u00e8tres de votre d\u00e9p\u00f4t ou de votre organisation.<br>Cette page fournit des informations sur :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>le nombre de t\u00e2ches ex\u00e9cut\u00e9es,<\/li>\n\n\n\n<li>la dur\u00e9e totale d\u2019ex\u00e9cution,<\/li>\n\n\n\n<li>les co\u00fbts associ\u00e9s.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Gestion de l\u2019acc\u00e8s<\/strong><\/h3>\n\n\n\n<p>Pour contr\u00f4ler l\u2019acc\u00e8s \u00e0 ces ex\u00e9cuteurs, vous pouvez configurer des&nbsp;<strong>strat\u00e9gies au niveau du d\u00e9p\u00f4t ou de l\u2019organisation<\/strong>.<br>Cela garantit que seuls les workflows ou les \u00e9quipes autoris\u00e9es peuvent utiliser ces ressources \u00e9lev\u00e9es.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Gestion des co\u00fbts<\/strong><\/h3>\n\n\n\n<p>Les ex\u00e9cuteurs plus puissants entra\u00eenent des&nbsp;<strong>co\u00fbts suppl\u00e9mentaires<\/strong>&nbsp;selon leur utilisation.<br>Voici quelques suggestions pour mieux g\u00e9rer ces co\u00fbts :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Utilisez-les uniquement pour les workflows n\u00e9cessitant des ressources \u00e9lev\u00e9es.<\/li>\n\n\n\n<li>R\u00e9duisez le temps d\u2019ex\u00e9cution en&nbsp;<strong>optimisant vos workflows<\/strong>.<\/li>\n\n\n\n<li>Surveillez r\u00e9guli\u00e8rement les&nbsp;<strong>d\u00e9tails de facturation<\/strong>&nbsp;pour suivre les d\u00e9penses.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Mise \u00e0 l\u2019\u00e9chelle des workflows<\/strong><\/h3>\n\n\n\n<p>Si vos workflows n\u00e9cessitent fr\u00e9quemment des ex\u00e9cuteurs plus puissants, envisagez les strat\u00e9gies suivantes :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Utiliser des&nbsp;<strong>ex\u00e9cuteurs auto-h\u00e9berg\u00e9s<\/strong>&nbsp;pour les charges de travail pr\u00e9visibles.<\/li>\n\n\n\n<li><strong>Fractionner les workflows<\/strong>&nbsp;en t\u00e2ches plus petites pour r\u00e9partir la charge entre les ex\u00e9cuteurs standards.<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ici, nous pr\u00e9sentons GitHub Actions et les workflows. Vous allez d\u00e9couvrir les types d\u2019actions que vous pouvez utiliser et o\u00f9 les trouver. Vous [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":5238,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"doc_badge":[],"class_list":["post-5246","docs","type-docs","status-publish","hentry"],"author_avatar":"https:\/\/secure.gravatar.com\/avatar\/6a70e7c73db9f245e650948d09d74f61?s=96&d=mm&r=g","author_name":"Annick N'dri","_links":{"self":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/5246"}],"collection":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/comments?post=5246"}],"version-history":[{"count":0,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/5246\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/5238"}],"wp:attachment":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/media?parent=5246"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_tag?post=5246"},{"taxonomy":"doc_badge","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_badge?post=5246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}