You may already be running unit-, integration- or other tests in yourĮxisting CI pipeline, but with continuous deployment tests become even more important as you want to avoid deployingīugs that could have been detected by automated tests. Let's start with a job to run automated tests. Will ensure that we only deploy to production if the commit is pushed to our main branch. The on: push line specifies that this workflow should be triggered by pushing new commits to any branch. github/workflows/ci-cd.yaml name : CI/CD on : push jobs : (.) In the root level of this file you can define the name of the workflow, the event that should trigger it, and the jobs I usually name itĬi-cd.yaml, build.yaml, or something similar. github/workflows, the file itself can have any name you like. GitHub Actions workflows can be created by creating a YAML file in the. I personally use this approach with a managed Kubernetes cluster from DigitalOcean However, the killer feature of GitHub Actions are the reusable actions which you can use in your workflows and whichĬan replace verbose shell commands, making your workflows much easier to read and maintain.įor building and deploying my applications to Kubernetes I use open-source actions such asĪzure/k8s-deploy which come with some featuresĪnd although being maintained by Microsoft Azure, the azure/k8s-deploy action works just as well on non-Azure GitHub Actions is free for public repositories and all GitHub plans come with an amount of free private build minutes GitHub Actions is GitHub's answer to CI/ CD platforms such as GitLab CI, Travis CI and CircleCI. Images to Kubernetes on every push to the main branch. I now almost exclusively use GitHub Actions to deploy my applicationsĪnd in this article I will show how I set up CI/ CD pipelines in GitHub Actions to test, build, push, and deploy Docker On and my homemade solution quickly became obsolete. That worked reasonably well, but since then I have started to implement continuous deployment for most projects I work Substitute image tags in my Kubernetes manifests with a unique tag for every deployment. Versioning to describe how I used bash and envsubst to Two years ago I wrote an article titled Simple Kubernetes deployment Continuous deployment to Kubernetes with GitHub Actions
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |