Automating your Cloud Deployments Using Semantic Release

Aaron Ginder
4 min readOct 8, 2021

Here is a 3 step guide to significantly improving your deployment process by taking out the manual tagging and pushing in GitHub. Be aware that semantic release can be used in any cloud provider environment (GCP, AWS or Azure).

Source: https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.globetesting.com%2Fwp-content%2Fuploads%2F2012%2F06%2Flifecycle1&psig=AOvVaw1o1bnyYb8ATrIKkijjZ2lE&ust=1633286215142000&source=images&cd=vfe&ved=0CAwQjhxqFwoTCKCzwb2vrPMCFQAAAAAdAAAAABAD

Step 1: Understand Semantic Release

Semantic release is an open-source npm framework that automates the release and deployment process of a source code base. Ever had to tag and push to your remote branch using git to trigger a CI/CD process? Semantic release handles that for you, including the versioning of your tags by parsing the commit message (known as semantic versioning).

Semantic release can even generate release notes and a changelog for you! This works by taking your commit message and tag version and compiles into a changelog markdown file. You need to do nothing!

Step 2: Create a Semantic Release Configuration File

The release configuration file, named .releaserc.json contains the details that will be used when running the semantic release package. These define the branch where you want to trigger a tag, additional plugins and importantly, the release rules that guide what to look for in a commit message. These rules determine how the semantic versioning will work in your pipeline.

Here is an example configuration file…

.releaserc.json

{
"branch": "master",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "eslint"
"releaseRules": [
{
"tag": "major",
"release": "major"
},
{
"tag": "fix",
"release": "patch"
},
{
"tag": "minor",
"release": "minor"
},
{
"tag": "update",
"release": "minor"
},
{
"tag": "upgrade",
"release": "minor"
},
{
"tag": "feat",
"release": "minor"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "eslint",
"releaseRules": [
{
"tag": "major"…

--

--

Aaron Ginder

An enthusiastic technologist looking to share my passion for cloud computing, programming and software engineering.