Skip to content

A minimal Node.js API demonstrating GitOps workflow with branches, pull requests, and version tags.

Notifications You must be signed in to change notification settings

kishxrx/gitops-workflow

Repository files navigation

GitOps Workflow Project

Python Version Framework CI/CD Containerization

This project demonstrates a complete Git and DevOps workflow, from version control to automated containerization and deployment. It showcases modern software development best practices.


About The Project

This repository contains a simple Flask web application that has been fully containerized with Docker and is set up for Continuous Integration and Continuous Deployment (CI/CD) using GitHub Actions.

The primary goals achieved in this project are:

  • Version Control: Professional Git branching strategy (main, dev, feature).
  • Containerization: A production-ready Docker setup using Gunicorn.
  • Automation: A CI/CD pipeline that automatically builds and pushes the Docker image to Docker Hub on every new release.

🔮 Future Vision

The long-term goal is to evolve this application into a "DevOps Daily Quote Engine" that displays a new, insightful quote about software development and operations on every page refresh.


🐳 Docker Hub Repository

The official Docker image for this project is hosted on Docker Hub.

https://hub.docker.com/r/kishxrx/gitops-workflow

You can pull the latest version using the following command:

docker pull kishxrx/gitops-workflow:latest

workflow Git & CI/CD Workflow

This project follows a modern DevOps workflow to ensure code quality and deployment reliability.

  1. Branching: All new work is done on feature/* branches, which are branched off dev.
  2. Pull Requests: Features are merged into dev via Pull Requests for review.
  3. Staging: The dev branch serves as a staging area for integrated features.
  4. Release: When ready for a new release, dev is merged into main.
  5. Automation: A new version tag (e.g., v1.2) is created on main. This tag push automatically triggers the GitHub Action.
  6. CI/CD Pipeline: The GitHub Action builds a new Docker image, tags it with the release version, and pushes it to Docker Hub, making it ready for deployment.

🧠 Project Learnings & Troubleshooting

A key part of this project was setting up and debugging the CI/CD pipeline. Here are some of the challenges faced and lessons learned:

  • Production Server: The initial Flask development server was upgraded to a production-grade WSGI server (Gunicorn) to ensure the Docker container was suitable for real-world use.
  • GitHub Actions Activation Issue: A significant challenge occurred where the GitHub Actions workflow was not being detected by the system. The "Actions" tab consistently showed "0 workflows" despite the .yml file being present in the correct .github/workflows/ directory on the main branch.

Troubleshooting Steps:

  • We repeatedly verified the file path and YAML syntax.

  • We confirmed that Actions were enabled in the repository settings.

  • We attempted to "unstick" the branch sync by making new commits and pull requests.

  • We even deleted and recreated the workflow file from scratch.

The Solution: The issue was resolved through manual intervention. By navigating to the "Actions" tab and manually triggering the workflow, we were able to force the system to recognize, validate, and execute the pipeline. This successful manual run created the repository on Docker Hub and confirmed the automation is now correctly set up to run automatically on all future version tags. This was a valuable lesson in how to resolve platform-side synchronization issues.

This troubleshooting process was a valuable, real-world example of how to diagnose and solve issues in a DevOps environment.


About

A minimal Node.js API demonstrating GitOps workflow with branches, pull requests, and version tags.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors