Software Development has evolved a lot, and Continuous Integration and Continuous Deployment (CI/CD) play a significant role in it. When we talk about CI/CD, there are two primary tools that we talk about. First is GitHub Actions and second is Jenkins.
In this blog, I will be taking you through the following things:
- Understanding CI/CD.
- How GitHub Actions work.
Understanding CI/CD
CI/CD is Continuous Integration and Continuous Deployment. To understand these terms let’s look at the following workflow diagram:
.
We tell GitHub Action what to do and when to use YAML files. Inside the YAML file, we write workflow. Simply a workflow is a collection of job definitions that will be executed concurrently as well as sequentially. A job consists of several steps which will be executed sequentially. By default, jobs run in parallel, but we can specify the dependence of one job on another, then the dependent job will start only when the job on which it depends on finishes its work.
To better understand the workflow look at the diagram below:
name:
We can start by giving workflow a name using the ‘name’ keyword, although it is not must to have it. If you do not provide a name to the workflow it will take the name as the name of the YAML file.
on:
Using the ‘on’ keyword we can specify the type of actions on which certain task has to be performed. We can only specify this only at one place in the code, i.e. you cannot have two ‘on’ in the file.
Ways of writing content inside ‘on’ section:
on: push
on: [push, pull_request]
# events on which actions should be triggered
on:
push:
branches: [ "main" ]
Check out more ways of writing this .
Support it by giving it a like 😊.
SOCIAL SHARE CARD GENERATOR