This repository demonstrates a production-grade CI/CD pipeline using:
- Docker
- GitHub Actions
- Artifactory (or any container registry)
- Multi-branch strategy
It supports:
- Feature → Dev → Prod promotion
- Tag-based releases
- Automated validation and gating
- Release creation and notifications
| Branch | Purpose |
|---|---|
main |
Production-ready code |
dev |
Pre-production / staging |
feature/* |
Feature development |
- Developers push code to
feature/*branches - PR is created to
dev
Triggered when:
- User selects
devenvironment manually
- Create a Git tag
- Build Docker image
- Push image to Artifactory (dev repo)
- Create a pre-release
- Send notification (success/failure)
Triggered when:
- User selects
prodenvironment - Provides a release tag
- ✅ Tag exists
- ✅ Docker image exists in dev registry
- ✅ Release/tag exists in GitHub
- Promote Docker image (dev → prod)
- Create GitHub Release
- Generate release notes
- Create PR (
dev→main) - Send notification
.
├── .github/
│ └── workflows/
│ └── ci.yml
├── app/
│ ├── __init__.py
│ └── routes.py
├── docs/
│ ├── api.md
│ ├── overview.md
│ └── setup.md
├── scripts/
│ ├── run.sh
│ └── test.sh
├── tests/
│ └── test_basic.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── README.md
└── .dockerignore
| Input | Description |
|---|---|
environment |
dev / prod |
tag |
Required for prod |
docker build -t <repo>:<tag> .
docker push <repo>:<tag>- Check tag exists
- Check Docker image exists
- Check GitHub release/tag exists
Example:
./scripts/validate.sh <tag>Instead of rebuilding:
- Pull from dev registry
- Retag
- Push to prod registry
docker pull dev-repo/app:<tag>
docker tag dev-repo/app:<tag> prod-repo/app:<tag>
docker push prod-repo/app:<tag>You can integrate:
- Email (SMTP)
- Slack
- Teams
Add in GitHub Secrets:
| Secret Name | Description |
|---|---|
DOCKER_USERNAME |
Docker registry username |
DOCKER_PASSWORD |
Docker registry password |
ARTIFACTORY_URL |
Registry URL |
EMAIL_USERNAME |
SMTP username |
EMAIL_PASSWORD |
SMTP password |
This repository includes a GitHub Actions workflow in .github/workflows/ci.yml that:
- checks out the code
- installs Python dependencies
- runs unit tests with
pytest - builds the Docker image
A docker-compose.yml file is provided for local development:
docker compose up --buildAdditional documentation is available in the docs/ folder:
docs/overview.md— project overview and structuredocs/setup.md— development, Docker, and test setupdocs/api.md— endpoint documentation
A simple Flask sample application is available under app/.
This version includes a multi-page site with HTML templates and CSS assets.
Run locally:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
set FLASK_APP=app
flask runVisit:
http://127.0.0.1:5000/http://127.0.0.1:5000/abouthttp://127.0.0.1:5000/contact
Build and run with Docker:
docker build -t flask-sample-app .
docker run -p 5000:5000 flask-sample-appRun with Docker Compose:
docker compose up --buildRun tests:
pip install pytest
pytest.
├── .github/
│ └── workflows/
│ └── ci.yml
├── app/
│ ├── __init__.py
│ └── routes.py
├── docs/
│ ├── api.md
│ ├── overview.md
│ └── setup.md
├── scripts/
│ ├── run.sh
│ └── test.sh
├── tests/
│ └── test_basic.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── README.md
├── .dockerignore
└── .gitignore
- Fork the repository
- Create a feature branch
- Submit a pull request
This project demonstrates a real-world Dev → Prod promotion pipeline with: