{"id":3471,"date":"2021-09-25T09:26:48","date_gmt":"2021-09-25T15:26:48","guid":{"rendered":"https:\/\/www.mooreds.com\/wordpress\/?p=3471"},"modified":"2021-09-25T09:26:48","modified_gmt":"2021-09-25T15:26:48","slug":"github-actions-and-workflows","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/3471","title":{"rendered":"GitHub actions and workflows"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-3474\" src=\"http:\/\/edit.mooreds.com\/wordpress\/wp-content\/uploads\/2021\/09\/gears-1236578_640-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"http:\/\/edit.mooreds.com\/wordpress\/wp-content\/uploads\/2021\/09\/gears-1236578_640-300x200.jpg 300w, http:\/\/edit.mooreds.com\/wordpress\/wp-content\/uploads\/2021\/09\/gears-1236578_640.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>I recently wrote my first real GitHub action workflow at work. It was to publish our website after a merge or push to our main branch.<\/p>\n<p>After this experience, I think these workflows are perfect for simple automation tasks. Things like:<\/p>\n<ul>\n<li>Running a linter like rubocop on your code<\/li>\n<li>Deploying a simple application (one or a few artifacts).<\/li>\n<li>Running unit and integration tests.<\/li>\n<\/ul>\n<p>I didn&#8217;t use self hosted actions, though that seems like a nice escape valve if you want to run things within your own network or run over limit. GitHub publishes the <a href=\"https:\/\/docs.github.com\/en\/billing\/managing-billing-for-github-actions\/about-billing-for-github-actions\">action and workflow limits<\/a> (storage, runtime) and that&#8217;s definitely worth reviewing.<\/p>\n<p>You also can easily stand up a couple of different <a href=\"https:\/\/docs.github.com\/en\/actions\/using-containerized-services\/about-service-containers\">service containers<\/a> (right now only postgresql and resdis) for easy integration testing. You can also abstract out your commonly used workflow segments to <a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/about-custom-actions\">versioned actions<\/a>.<\/p>\n<p>It was really a pain to write the workflow, however. I had to push repeatedly to our mainline branch, and there were times I screwed up the YAML or didn&#8217;t have my script correct. The feedback loop was slooow. Ouch. There are solutions to <a href=\"https:\/\/github.com\/nektos\/act\">run them locally<\/a>, but I didn&#8217;t try it yet.<\/p>\n<p>Other than that, it was a positive experience. If you are using GitHub and have automation needs, take a look at GitHub actions. I am a big fan of CircleCI and have <a href=\"https:\/\/www.mooreds.com\/wordpress\/?s=circleci\">been for years<\/a>. GitHub actions covers a lot of the same ground. GitHub actions are less sophisticated, but it seems like a definite &#8220;innovators dilemma&#8221; play. So I expect to see actions to get more and more sophisticated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently wrote my first real GitHub action workflow at work. It was to publish our website after a merge or push to our main branch. After this experience, I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,37,33],"tags":[],"class_list":["post-3471","post","type-post","status-publish","format-standard","hentry","category-programming","category-tips","category-useful-tools"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3471","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=3471"}],"version-history":[{"count":3,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3471\/revisions"}],"predecessor-version":[{"id":3475,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/3471\/revisions\/3475"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}