In this introduction to GitHub Actions, we’ll explore how to build and deploy a Python Flask application to AWS Elastic Beanstalk.
Welcome to the first part of a series of articles comparing CI/CD platforms. To help evaluate, compare and contrast the tools currently dominating the market, the goal will be to automate the deployment of a Flask application onto AWS Elastic Beanstalk. A new deployment will need to occur after every push to main branch, and during the series this same requirement will be implemented across a multitude of CI/CD tools.
First up, part 1 will focus on GitHub Actions, where the support for CI/CD was first announced in August 2019. I’ll document the steps taken along the way to achieve the goal with GitHub Actions, and there’s a write up of the positives and negatives in a conclusion at the end of this article.
The Flask application
Our Flask application is a simple “Hello World” example, and for the purposes of demonstrating running unit tests within the pipeline, we have included a test case as well.
AWS Elastic Beanstalk
Our Flask application is going to be deployed to AWS Elastic Beanstalk which is a service that automates the deployment and scaling of a web application. It takes in our source code and takes care of all the infrastructure configuration.
There’s a handy CLI for Elastic Beanstalk, and ultimately we’re going to automate the following commands into our pipeline. However, these are just for reference and you do not need to run these now.
$ eb init -p python-3.6 hello-world --region us-east-1 $ eb create hello-world-env
Introduction to GitHub Actions…
A job _runner _is any machine with the GitHub Actions Runner Application installed — these machines can be GitHub-hosted or you can run your own.
GitHub-hosted runners are virtual machines — Linux (Ubuntu), Windows, and macOS — and are fully managed by GitHub and come with a lot of installed software. For example, the image for Ubuntu comes armed with multiple libraries, including the AWS CLI and Google SDK. As part of the free-tier, GitHub provides 2,000 minutes per month of its hosted runners.
The runner is defined in the workflow yaml with the
In this article I’d be going through the process of deploying Node application on AWS Elastic BeanStalk using Github Actions.
Earlier this week, GitHub announced a new feature which allows developers to trigger workflows manually from within the “Actions” tab. This has been one of the most heavily requested features for some time now, with the official support thread attracting hundreds of upvotes over the last 12 months — so does it deliver all that’s been promised? The short answer is yes, but not without a few pitfalls. Let’s dive in. Option 1: Basic Setup To create your first manual workflow, you’ll want to use the new workflow_dispatch trigger: A very simple manual workflow trigger. Once you add this file to your repository, you’ll be able to see and manually run the workflow from the “Actions” tab on GitHub: First select “Actions”, then “My First Manual Workflow”, then “Run workflow” followed by the “Run workflow” button. You’ll also notice that you can customise the branch to run your manual workflow against, however be advised that at least some variation of the workflow file must be on your default branch (e.g master) for it to appear in the “Actions” tab. Selecting a custom branch will: Checkout the latest commit from that branch. Use the branch’s own variation of the workflow file (if modified).
DevOps is supposed to help streamline the process of taking code changes and getting them to production for users to enjoy. But what exactly does it mean for the process to be "streamlined"? One way to answer this is to start measuring metrics.
Earlier this week, GitHub announced a new feature which allows developers to trigger workflows manually from within the “Actions” tab.
Enable Continuous Delivery of Your Résumé with GitHub Actions. My résumé lives in a private GitHub repository. I use TeX, which is a popular typesetting language, to compose my résumé. GitHub has now patched this disconnect between your code and the DevOps services with a new feature named GitHub Actions.