Day 13 - GitHub Actions
Hi there! I'm Dinesh, a passionate Cloud and DevOps enthusiast. I love to dive into the latest new technologies and sharing my journey through blog.
Search for a command to run...
Hi there! I'm Dinesh, a passionate Cloud and DevOps enthusiast. I love to dive into the latest new technologies and sharing my journey through blog.
No comments yet. Be the first to comment.
1. Difference between Docker and Kubernetes Docker → Builds and runs containers.Kubernetes → Orchestrates containers across multiple nodes. Key points: Docker = container runtime. Kubernetes = container orchestration tool. Kubernetes provides auto...
In this session, we learn how to monitor a Kubernetes cluster using Prometheus and Grafana.This is not just theory — there is a GitHub repository containing all installation commands and demo steps.The repo will also be enhanced later with advanced K...
1. What is a ConfigMap in Kubernetes? A ConfigMap is used to store non-sensitive configuration data that your application needs — such as: Database port Connection type Any general configuration values In normal applications (non-Kubernetes), de...
Kubernetes normally supports built-in resources like: Deployment Service Pod ConfigMap Secret Ingress These are called native resources. Sometimes companies (Istio, ArgoCD, Prometheus Operator, Kyverno, etc.) want to add new features that Kub...
1. Why Kubernetes Services Are Needed When a Pod is created in Kubernetes, it receives a dynamic IP address.If the Pod dies and restarts, its IP changes.So other Pods (like checkout → payments) cannot rely on Pod IP because it changes, creating issue...
GitHub Actions is another CI/CD solution.
It works similarly to Jenkins — it performs Continuous Integration and Continuous Delivery tasks.
The main difference:
GitHub Actions works only with GitHub
GitLab CI works only with GitLab
So before choosing GitHub Actions or GitLab CI, an organization must consider whether they will stay on that platform in the future.
If a company may move to a different platform later (like GitHub → GitLab → AWS → Azure DevOps → self-hosted Git), GitHub Actions or GitLab CI is not ideal because they are tied to their respective platforms.
Like you choose Terraform over CloudFormation because Terraform works across multiple clouds, choosing GitHub Actions makes sense only if you plan to stay on GitHub.
Even though GitHub Actions is powerful and often better than Jenkins, platform-lock-in is its main limitation.
You don't install plugins manually.
To use GitHub Actions, create a folder in your repository:
.github/workflows
Inside this folder, you create YAML files (your pipelines).
Example:
If you write on: push in the first line, it means:
It doesn’t matter what kind of commit it is—any push will trigger the workflow.
You can have multiple workflow files (10, 20, or more).
Each can handle different jobs, such as:
Checking pull-request description
Linting or formatting checks
Running CI
Running CD
Companies often split workflows this way.
The ArgoCD project is shown as an example.
Their .github/workflows folder has multiple workflows such as CI build, code checks, PR title check, release, and security scanning.
GitHub will run any workflow whose trigger condition matches.
A simple Python example is used.
Inside an src folder, an addition.py program contains:
A simple addition function
A unit test for that function
The workflow should:
Run on every commit
Check out the code
Create a Python environment
Install dependencies
Run the tests
When a commit is made (adding a comment in the example), GitHub Actions automatically starts running the workflow.
The logs show steps like:
Set up job
Check out the repository
Set up Python
Install dependencies
Run tests
Complete job
Everything is written in the workflow YAML file.
YAML formatting makes it easy (similar to Kubernetes YAML).
You define:
Workflow name
Trigger event
Jobs
Container image (Ubuntu latest)
Multiple Python versions (e.g., 3.8 and 3.9)
→ which is why two jobs were executed
Then steps are defined:
Checkout plugin
Setup Python plugin
Install dependencies
Run tests
GitHub Actions has a marketplace of plugins.
You don’t install plugins manually (unlike Jenkins).
They are available by default.
Example:actions/checkout@v3
→ checks out the repo
actions/setup-python@v2
→ sets up Python
The number after @ is plugin version, not Python version.
The same pattern applies to Java, Node, Ruby, etc.
Only the plugin name changes.
The biggest advantage:
Very little code is needed because most work is done by plugins.
The disadvantage:
Plugins are still limited because GitHub Actions is newer compared to older tools like Jenkins.
In GitHub repository settings, you can add self-hosted runners.
You may need this if:
GitHub’s default runners are too small
You need more compute for tasks like load testing
You need internal security/compliance
Then the workflow runs on your own machines instead of GitHub’s machines.
GitHub Actions allows securely storing secrets, such as:
kubeconfig
Sonar token
Passwords or keys
These can be used inside workflows.
The Java + Maven + Sonar + Kubernetes example demonstrates this.
GitHub Actions is platform-dependent.
If you move from GitHub to another platform (GitLab, AWS CodeCommit, Azure DevOps), your GitHub Actions pipelines cannot be reused.
No hosting effort
Less maintenance
Simple UI and easy pipeline creation
Cost
Free for public repositories
Limited free minutes for private repositories
Still cheaper than maintaining Jenkins infrastructure
Because of this, ~90% of open-source projects prefer GitHub Actions.
GitHub Actions is an easy, plugin-driven CI/CD solution built for GitHub.
It is great when your codebase will stay on GitHub.
It removes maintenance overhead, provides free execution for public repos, supports secrets, supports custom runners, and is simpler than Jenkins.
However, it locks you to GitHub.
If your organization might switch to another platform, GitHub Actions is not ideal.