{"id":3550,"date":"2022-11-03T07:39:33","date_gmt":"2022-11-03T13:39:33","guid":{"rendered":"https:\/\/www.mooreds.com\/wordpress\/?p=3550"},"modified":"2022-10-30T08:10:03","modified_gmt":"2022-10-30T14:10:03","slug":"github-actions-are-amazingly-easy","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/3550","title":{"rendered":"GitHub Actions Are Amazingly Easy"},"content":{"rendered":"<p>GitHub Workflows are automated jobs that can be triggered by various events against a GitHub repository. They are pretty awesome.<\/p>\n<p>GitHub Actions are a way to encapsulate configuration and functionality in a way that can be easily reused in GitHub Workflows.<\/p>\n<p>I was thinking it&#8217;d be fun to create some GitHub Actions (yes, I&#8217;m the life of the party), so I sat down a few mornings ago to do this. I was shocked at how easy it was.<\/p>\n<p>I followed a few lines of <a href=\"https:\/\/lo-victoria.com\/github-actions-101-creating-your-first-workflow\">this tutorial<\/a> to <a href=\"https:\/\/github.com\/mooreds\/test-gh-workflow\/\">create a workflow<\/a>. Then I <a href=\"https:\/\/github.com\/mooreds\/test-gh-action\">created an action<\/a> by following <a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-composite-action\">this tutorial<\/a>. Finally, I edited my workflow to use the new action. That was it.<\/p>\n<p>It was amazingly simple and took me about 30 minutes. I ran into one unrelated issue (to set the executable bit on a shell script in windows, I had to modify the shell script contents in order to ensure the change was sent to the remote repo).<\/p>\n<p>If you take a look, you&#8217;ll see these are both toy repositories, to be sure. However, the ability to write jobs which will be executed on a git push, pull request or <a href=\"https:\/\/docs.github.com\/en\/actions\/using-workflows\/events-that-trigger-workflows\">other events<\/a> is great and removes toil. Being able to extract common functionality to an action is even better. Finally, the ability to share the action publicly by adding it to the <a href=\"https:\/\/github.com\/marketplace\/\">GitHub marketplace<\/a> is fantastic.<\/p>\n<p>I&#8217;ve liked <a href=\"https:\/\/www.mooreds.com\/wordpress\/archives\/2511\">CircleCI for a long time<\/a>, but if I were them I&#8217;d be worried.<\/p>\n<p>One issue I found is that the testing\/release cycle is pretty tedious (I&#8217;ve mentioned that <a href=\"https:\/\/twitter.com\/mooreds\/status\/1539613568147922944\">action debugging to be an issue for a while<\/a>).<\/p>\n<p>While I was troubleshooting my executable bit error, I had to do the following every time I wanted to test a change:<\/p>\n<ul>\n<li>make a change in the action repository<\/li>\n<li>create a new tag<\/li>\n<li>push it to the remote<\/li>\n<li>switch to the workflow repository<\/li>\n<li>bump the action version<\/li>\n<li>push to the remote<\/li>\n<li>wait for the workflow to complete<\/li>\n<\/ul>\n<p>Not horrific, but pretty tedious. I don&#8217;t know if there are other options such as local deployment which would reduce that cycle, but that would be swell.<\/p>\n<p>Other than that, 10 out of 10, would write more actions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Workflows are automated jobs that can be triggered by various events against a GitHub repository. They are pretty awesome. GitHub Actions are a way to encapsulate configuration and functionality [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84,6,4,37,33],"tags":[],"class_list":["post-3550","post","type-post","status-publish","format-standard","hentry","category-devops","category-programming","category-technology","category-tips","category-useful-tools"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3550"}],"version-history":[{"count":1,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3550\/revisions"}],"predecessor-version":[{"id":3551,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3550\/revisions\/3551"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}