How to Build a CI/CD Pipeline Using GitHub Actions (Step-by-Step)
A beginner-friendly guide to automating builds and deployments
I build and deploy cloud-native applications using AWS and DevOps practices. I share practical tutorials on CI/CD pipelines, serverless architectures, and real project learnings, and I’m exploring MLOps.
Introduction
What is CI/CD?
Why GitHub Actions
Basic CI/CD Flow
Sample GitHub Actions Workflow
What I Learned
Conclusion
Introduction
In modern software development, manually building and deploying applications is time-consuming and error-prone. CI/CD helps automate this process and ensures faster, reliable deployments.
In this blog, I’ll explain how to build a simple CI/CD pipeline using GitHub Actions, based on how I implemented it in my own project. This guide is beginner-friendly and focuses on practical steps rather than theory.
What is CI/CD ?
CI/CD stands for Continuous Integration and Continuous Deployment.
Continuous Integration automatically builds and tests code when changes are pushed, while Continuous Deployment automatically deploys the application after successful builds.
Why GitHub Actions
GitHub Actions is a CI/CD tool built directly into GitHub. It allows us to automate workflows such as building, testing, and deploying applications whenever code is pushed to a repository.
It is easy to set up, free for small projects, and integrates well with cloud platforms.
Basic CI/CD Flow
The basic CI/CD flow using GitHub Actions looks like this:
Developer pushes code to GitHub
GitHub Actions workflow is triggered
Application is built and tested
Deployment step runs automatically
Sample GitHub Actions Workflow File:
GitHub Actions workflows are defined using YAML files inside the .github/workflows directory.
Below is the simple GitHub action Yaml file:

name: The name of the workflow.
on: Defines when the workflow should run.
push: Triggers the pipeline whenever code is pushed.
branches: Specifies which branch should trigger the workflow.
main: The pipeline runs only when changes are pushed to the
mainbranch.jobs: Contains one or more jobs that will run in the workflow.
build: The name of the job (you can name it anything).
runs-on: Specifies the operating system for the job.
ubuntu-latest: Uses the latest Ubuntu runner provided by GitHub.
steps: A sequence of tasks that will be executed one by one inside the job.
name: A readable label for the step.
uses: Runs a prebuilt GitHub Action.
actions/checkout@v3: Checks out the repository code so the workflow can access it.
run: Executes shell commands.
What I Learned
By implementing this CI/CD pipeline, I learned how GitHub Actions automates workflows, reduces manual effort, and improves deployment reliability. Even a basic pipeline can significantly improve development speed and confidence.
Conclusion
This blog covered the basics of setting up a CI/CD pipeline using GitHub Actions. This is a starting point, and the pipeline can be extended further based on project requirements.