How CI/CD Works
The Importance and Secrets of CI/CD
As time and information rapidly evolve, many new technologies emerge that automate the human factor. Many developers think that CI/CD is just a toolset for DevOps engineers, but the pace of development forces developers to learn and apply new technologies. To enhance your professional level, I recommend learning this technology as well. It will help you stay competitive in the market.
Modern software development requires fast development and high-quality assurance. To achieve this, the Continuous Integration and Continuous Deployment (CI/CD) methodology is used.
CI/CD automates the processes of code integration, testing, and deployment, which reduces the number of manual actions, accelerates the release of new features, and improves software reliability.
Implementing CI/CD is important for both small and large software projects, as it improves the efficiency of the development process and reduces the likelihood of errors in the production environment.
Implementing CI/CD requires a phased approach, including tool selection, environment setup, planning, and automation.
Depending on the technology stack, various CI/CD tools can be selected, such as:
The main goal of CI is to automatically check and test every change in the code.
.github/workflows/ci.yml
, .gitlab-ci.yml
, or Jenkinsfile
).CD ensures that code passing tests is automatically deployed to the server or cloud environment.
At the end of the article, I will share my git repository, where you can find several examples.
Additionally, I will explain the YAML format and its usage guidelines.
YAML (Yet Another Markup Language or YAML Ain't Markup Language) is a readable and lightweight data serialization language widely used for configuration files. YAML is particularly suitable for CI/CD planning (GitHub Actions, GitLab CI/CD, Jenkins), Docker Compose, Kubernetes, Ansible, and other DevOps tools.
✅ Simple and hierarchical structure
YAML uses unique indentation to define hierarchy (instead of braces or markup tags like in JSON or XML).
app:
name: "My Application"
version: 1.0
environment: "production"
🔹 Indentation is required, use 2 or 4 spaces (not tabs).
🔹 Text values can be quoted as "string"
or without quotes.
In YAML, lists (arrays) are represented with the "-" symbol.
freamworks:
- React
- Vue
- Angula
🔹 They can also be in key-value format.
database:
mysql:
version: "8.0"
port: 3306
psotgresql:
version: "15"
port: 5432
If you need to write multiline values, use the | (literal block) or > (folded block) symbol.
message: |
This is a multi-line
text that is preserved
in the same form.
message: >
This is multi-line text,
but each new line is
converted to a space.
If you need to write multiline values, use the | (literal block) or > (folded block) symbol.
🔹 Boolean values can be true/false
, on/off
, yes/no
.
🔹 Numbers can be integers (integer) or floating-point (float).
YAML allows data reuse using &anchor
and *alias
symbols.
default_config: &config
retries: 3
timeout: 10
log_level: "debug"
service_1:
<<: &config
name: "API Service"
service_1:
<<: &config
name: "Worker Service"
🔹 ❬❬ *config
means that service_1 and service_2 inherit the default_config
values.
❌ Using tabs
✅ Use 2 or 4 spaces instead of tabs.
You can find more detailed information in my git repository.