{"id":71,"date":"2023-01-12T18:12:12","date_gmt":"2023-01-12T23:12:12","guid":{"rendered":"https:\/\/shagun.dev\/?p=71"},"modified":"2025-01-09T20:15:39","modified_gmt":"2025-01-10T01:15:39","slug":"workflow-actions-in-github","status":"publish","type":"post","link":"https:\/\/shagun.dev\/?p=71","title":{"rendered":"Workflow actions in Github"},"content":{"rendered":"\n<p>A workflow is an automated procedure that can be configured to execute one or more operations. Workflows are defined by a YAML file that is checked into your repository and run when prompted <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>by an event there, manually, or according to a set schedule.<\/p>\n\n\n\n<p>The given main.yaml file is a basic example of workflow in GitHub. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>name: GitHub Actions Demo\nrun-name: Shagun is testing out GitHub Actions \ud83d\ude80\non: &#91;push]\n\njobs:\n  build:\n    name: Basic Example\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions\/checkout@v2\n    - name: Run a multi-line script\n      run: |\n        echo Add other actions to build,\n        echo test, and deploy your project.<\/code><\/pre>\n\n\n\n<p>The given workflow will run whenever new code is pushed to the repository. <br> <\/p>\n\n\n\n<p>There simple steps to create it: <br>1. Clone the repository to local system <br>2. You need to create .github\/workflows folder inside your repository<br>3. Add main.yaml file under the workflows directory and paste the above code written<br>4. Create a new commit and push the code<br>5. Go to Github &gt; Actions &gt; Workflow.<br>     Now you can see the created workflow as shown : <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"340\" src=\"https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-1024x340.png\" alt=\"\" class=\"wp-image-73\" srcset=\"https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-1024x340.png 1024w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-300x99.png 300w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-768x255.png 768w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-1536x509.png 1536w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.02-PM-2048x679.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"450\" src=\"https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-1024x450.png\" alt=\"\" class=\"wp-image-74\" srcset=\"https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-1024x450.png 1024w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-300x132.png 300w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-768x337.png 768w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-1536x674.png 1536w, https:\/\/shagun.dev\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-12-at-2.04.21-PM-2048x899.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A workflow is an automated procedure that can be configured to execute one or more operations. Workflows are defined by a YAML file that is checked into your repository and run when prompted<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shagun.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=71"}],"version-history":[{"count":9,"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/shagun.dev\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/shagun.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shagun.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shagun.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}