GitHub Actions Day 27: Deploy to Cloud
This is day 27 of my GitHub Actions Advent Calendar. If you want to see the whole list of tips as they're published, see the index.
Advent calendars usually run through Christmas, but I'm going to keep posting about GitHub Actions through the end of December. Consider it bonus content!
So far this month, we've looked at a lot of ways to build and test your software. And we've looked at a few ways to package up your software. But how do you actually get it running in your cloud service provider?
As my buddy Damian says, "friends don't let friends right-click publish". Instead, a best practice is to script your deployments so that they're reliable and reproducible.
Several cloud providers have created actions to help you deploy to their services as part of your workflow.
The AWS team has created several actions that will help you deploy. They've also created a sample workflow to show you how to push an image to Amazon Elastic Container Registry (ECR), update an Elastic Container Service (ECS) definition and then deploy that definition.
The Azure team has also been busy creating actions. And they also get the prize for creating the most complete set of starter workflows that you can use as examples and starting points. Want to deploy a serverless Function App? They've got examples for that. Deploying a database? Sure, they've got examples for that, too. Kubernetes? You bet. It seems that whatever you want to deploy to Azure, they have a sample workflow for.
Google Cloud Platform
The Google Cloud team has also created actions to help you deploy to
Google Cloud Platform. They've got an action to set up the Google
Cloud SDK so that you can use the
gcloud command line application
to script your deploys. Better yet -- if you need help, you can
drop by their slack.
And Anywhere Else
Of course, since it's easy to run scripts as a workflow, you can set up
a workflow that will deploy wherever you want -- whether that's using
the AWS, Azure or Google Cloud actions to help you, or writing a workflow
scps your code up to your own servers.