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: