# trainwithshubham/github-actions-zero-to-hero architecture

> Architecture diagram of the GitHub repository trainwithshubham/github-actions-zero-to-hero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trainwithshubham/github-actions-zero-to-hero
- Repository: https://github.com/trainwithshubham/github-actions-zero-to-hero

## Overview

This repository is a GitHub Actions learning project centered on a Flask app and its CI/CD and DevSecOps workflows. The app serves a page and a health check; the workflows demonstrate manual and event-triggered checks, security scans, image publishing, and deployment. Workflow relationships and the portfolio deployment are documented in the README; only the Flask route-to-template call was verified in source excerpts, so other links rely on README evidence.

Main entry points: [`.github/workflows/devsecops-pipeline.yml`](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/devsecops-pipeline.yml) (Pipeline orchestrator), [`.github/workflows/docker-build-push.yml`](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/docker-build-push.yml) (Image build and push), [`.github/workflows/deploy-to-server.yml`](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/deploy-to-server.yml) (Server deploy), [`app.py`](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/app.py) (Flask routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
  node_template["App frontend<br/>[index.html]"]
  node_portfolio["Portfolio site<br/>[index.html]"]
end

subgraph group_fundamentals["Workflow fundamentals"]
  node_hello["Workflow basics<br/>[hello.yml]"]
  node_cicd["Manual CI/CD<br/>[cicd.yml]"]
  node_pages["Pages deploy"]
  node_python["Python lint matrix<br/>[python-matrix.yml]"]
end

subgraph group_security["DevSecOps pipeline"]
  node_orchestrator["Pipeline orchestrator"]
  node_quality["Code quality<br/>[code-quality.yml]"]
  node_secrets["Secrets scan<br/>[secrets-scan.yml]"]
  node_dependencies["Dependency scan"]
  node_dockerlint["Docker lint<br/>[docker-lint.yml]"]
  node_tests["Route tests<br/>[tests.yml]"]
end

subgraph group_delivery["Container delivery"]
  node_build["Image build and push"]
  node_image_scan["Image scan<br/>[image-scan.yml]"]
  node_deploy_app["Self-hosted deploy<br/>[deploy-app.yml]"]
  node_deploy_server["Server deploy"]
  node_dockerfile["Container definition"]
  node_compose["Compose deployment config<br/>[docker-compose.yml]"]
end

node_user(("App user"))
node_github["GitHub Actions"]
node_registry[("Docker Hub")]
node_server["EC2 server"]

node_user -->|"requests routes"| node_app
node_app -->|"renders page"| node_template
node_github -->|"runs"| node_hello
node_github -->|"runs manually"| node_cicd
node_github -->|"deploys site"| node_pages
node_portfolio -->|"published by"| node_pages
node_github -->|"runs lint matrix"| node_python
node_github -->|"triggers on push"| node_orchestrator
node_orchestrator -->|"invokes"| node_quality
node_orchestrator -->|"invokes"| node_secrets
node_orchestrator -->|"invokes"| node_dependencies
node_orchestrator -->|"invokes"| node_dockerlint
node_orchestrator -->|"invokes"| node_tests
node_orchestrator -->|"invokes after checks"| node_build
node_build -->|"pushes image"| node_registry
node_orchestrator -->|"invokes after build"| node_image_scan
node_image_scan -->|"scans image"| node_registry
node_orchestrator -->|"invokes after scan"| node_deploy_server
node_deploy_server -->|"deploys remotely"| node_server
node_deploy_app -->|"deploys with"| node_compose
node_deploy_server -->|"deploys with"| node_compose
node_dockerlint -->|"checks"| node_dockerfile
node_build -->|"builds from"| node_dockerfile
node_server -->|"runs deployed app"| node_app

click node_app "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/app.py"
click node_template "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/templates/index.html"
click node_portfolio "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/index.html"
click node_hello "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/hello.yml"
click node_cicd "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/cicd.yml"
click node_pages "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/portfolio-deploy.yml"
click node_python "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/python-matrix.yml"
click node_orchestrator "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/devsecops-pipeline.yml"
click node_quality "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/code-quality.yml"
click node_secrets "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/secrets-scan.yml"
click node_dependencies "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/dependency-scan.yml"
click node_dockerlint "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/docker-lint.yml"
click node_tests "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/tests.yml"
click node_build "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/docker-build-push.yml"
click node_image_scan "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/image-scan.yml"
click node_deploy_app "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/deploy-app.yml"
click node_deploy_server "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/deploy-to-server.yml"
click node_dockerfile "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/Dockerfile"
click node_compose "https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_template,node_portfolio,node_user toneBlue
class node_hello,node_cicd,node_pages,node_python,node_registry toneAmber
class node_orchestrator,node_quality,node_secrets,node_dependencies,node_dockerlint,node_tests,node_server toneMint
class node_build,node_image_scan,node_deploy_app,node_deploy_server,node_dockerfile,node_compose toneRose
class node_github toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/app.py): `app.py`
- [App frontend](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/templates/index.html): `templates/index.html`
- [Portfolio site](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/index.html): `index.html`

### Workflow fundamentals

- [Workflow basics](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/hello.yml): `.github/workflows/hello.yml`
- [Manual CI/CD](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/cicd.yml): `.github/workflows/cicd.yml`
- [Pages deploy](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/portfolio-deploy.yml): `.github/workflows/portfolio-deploy.yml`
- [Python lint matrix](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/python-matrix.yml): `.github/workflows/python-matrix.yml`

### DevSecOps pipeline

- [Pipeline orchestrator](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/devsecops-pipeline.yml): `.github/workflows/devsecops-pipeline.yml`
- [Code quality](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/code-quality.yml): `.github/workflows/code-quality.yml`
- [Secrets scan](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/secrets-scan.yml): `.github/workflows/secrets-scan.yml`
- [Dependency scan](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/dependency-scan.yml): `.github/workflows/dependency-scan.yml`
- [Docker lint](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/docker-lint.yml): `.github/workflows/docker-lint.yml`
- [Route tests](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/tests.yml): `.github/workflows/tests.yml`

### Container delivery

- [Image build and push](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/docker-build-push.yml): `.github/workflows/docker-build-push.yml`
- [Image scan](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/image-scan.yml): `.github/workflows/image-scan.yml`
- [Self-hosted deploy](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/deploy-app.yml): `.github/workflows/deploy-app.yml`
- [Server deploy](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/.github/workflows/deploy-to-server.yml): `.github/workflows/deploy-to-server.yml`
- [Container definition](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/Dockerfile): `Dockerfile`
- [Compose deployment config](https://github.com/trainwithshubham/github-actions-zero-to-hero/blob/main/docker-compose.yml): `docker-compose.yml`

### Other components

- **App user**
- **GitHub Actions**
- **Docker Hub**
- **EC2 server**

## Connections

- App user → Flask routes: requests routes (evidence: `README.md`)
- Flask routes → App frontend: renders page (evidence: `app.py`)
- GitHub Actions → Workflow basics: runs (evidence: `README.md`)
- GitHub Actions → Manual CI/CD: runs manually (evidence: `README.md`)
- GitHub Actions → Pages deploy: deploys site (evidence: `README.md`)
- Portfolio site → Pages deploy: published by (evidence: `README.md`)
- GitHub Actions → Python lint matrix: runs lint matrix (evidence: `README.md`)
- GitHub Actions → Pipeline orchestrator: triggers on push (evidence: `README.md`)
- Pipeline orchestrator → Code quality: invokes (evidence: `README.md`)
- Pipeline orchestrator → Secrets scan: invokes (evidence: `README.md`)
- Pipeline orchestrator → Dependency scan: invokes (evidence: `README.md`)
- Pipeline orchestrator → Docker lint: invokes (evidence: `README.md`)
- Pipeline orchestrator → Route tests: invokes (evidence: `README.md`)
- Pipeline orchestrator → Image build and push: invokes after checks (evidence: `README.md`)
- Image build and push → Docker Hub: pushes image (evidence: `README.md`)
- Pipeline orchestrator → Image scan: invokes after build (evidence: `README.md`)
- Image scan → Docker Hub: scans image (evidence: `README.md`)
- Pipeline orchestrator → Server deploy: invokes after scan (evidence: `README.md`)
- Server deploy → EC2 server: deploys remotely (evidence: `README.md`)
- Self-hosted deploy → Compose deployment config: deploys with (evidence: `README.md`)
- Server deploy → Compose deployment config: deploys with (evidence: `README.md`)
- Docker lint → Container definition: checks (evidence: `README.md`)
- Image build and push → Container definition: builds from (evidence: `README.md`)
- EC2 server → Flask routes: runs deployed app (evidence: `README.md`)
