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

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

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

## Overview

##### Project type and purpose
- This is neither a traditional web app nor a compiler, but a “GitHub Actions example library.” Its goal is to help users get up and running with GitHub Actions by providing sample workflows (in .github/workflows and examples/) plus a tiny Python script (src/addition.py) to exercise simple CI steps.

##### File structure
- Top-level:
- .github/workflows/first-actions.yml – the “starter” workflow.
- examples/ – a set of specialized deployment workflows (Java+Maven+Sonar→K8s, deploy-to-k8s, deploy-to-swarm).
- src/addition.py – trivial Python code to illustrate a build/test action.
- No “frontend” or “backend” directories; instead the repo itself is the “action-library” component.
- No service code or servers; instead you have pipeline definitions and hooks into external infra (Kubernetes, Docker Swarm, SonarQube, Maven Central, Docker registry).

##### README for architecture clues
- README positions GitHub Actions as a hosted CI/CD platform, highlights its advantages vs Jenkins.

##### Detailed capture of architectural elements
- That the examples folder is not executed on every push but can be enabled by selecting that workflow in GitHub’s UI

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer"]:::external
    GitHubRepo["GitHub Repo"]:::github
    README["README.md"]:::script
    Developer -->|push/PR| GitHubRepo
    GitHubRepo --> README
    click README "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/README.md"

    subgraph "Workflow Definitions"
        WFDir[".github/workflows/"]:::workflows
        StarterWF["first-actions.yml"]:::workflows
        WFDir --> StarterWF
        click WFDir "https://github.com/jadhavnihal10/github-actions-zero-to-hero/tree/main/.github/workflows/"
        click StarterWF "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/.github/workflows/first-actions.yml"
    end

    subgraph "Example Pipelines"
        ExamplesDir["examples/"]:::workflows
        JWMSKS["deploy-java-with-maven-sonar-k8s.yml"]:::workflows
        K8SWF["deploy-to-k8s.yml"]:::workflows
        SwarmWF["deploy-to-swarm.yml"]:::workflows
        ExamplesDir --> JWMSKS
        ExamplesDir --> K8SWF
        ExamplesDir --> SwarmWF
        click ExamplesDir "https://github.com/jadhavnihal10/github-actions-zero-to-hero/tree/main/examples/"
        click JWMSKS "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/examples/deploy-java-with-maven-sonar-k8s.yml"
        click K8SWF "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/examples/deploy-to-k8s.yml"
        click SwarmWF "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/examples/deploy-to-swarm.yml"
    end

    GitHubRepo --> WFDir
    GitHubRepo --> ExamplesDir

    ActionsEngine["Actions Engine"]:::github
    GitHubRepo --> ActionsEngine

    HostedRunner["Hosted Runner"]:::runner
    SelfRunner["Self-Hosted Runner"]:::runner
    ActionsEngine --> HostedRunner
    ActionsEngine --> SelfRunner

    HostedRunner --> Steps
    SelfRunner --> Steps

    subgraph "Workflow Steps"
        Checkout["checkout code"]:::workflows
        SetupPY["setup-python"]:::workflows
        RunScript["run addition.py"]:::script
        BuildDocker["build Docker image"]:::workflows
        SonarScan["SonarQube scan"]:::workflows
        DeployK8s["kubectl apply (K8s)"]:::workflows
        DeploySwarm["docker swarm deploy"]:::workflows

        Steps --> Checkout --> SetupPY --> RunScript --> BuildDocker --> SonarScan --> DeployK8s --> DeploySwarm
        click RunScript "https://github.com/jadhavnihal10/github-actions-zero-to-hero/blob/main/src/addition.py"
    end

    subgraph "External Services"
        DockerRegistry["Docker Registry"]:::external
        SonarQube["SonarQube Server"]:::external
        K8sCluster["Kubernetes Cluster"]:::external
        SwarmManager["Docker Swarm Manager"]:::external
    end

    BuildDocker --> DockerRegistry
    SonarScan --> SonarQube
    DeployK8s --> K8sCluster
    DeploySwarm --> SwarmManager

    classDef github fill:#ccefff,stroke:#000;
    classDef runner fill:#ccffcc,stroke:#000;
    classDef external fill:#ffdd99,stroke:#000;
    classDef workflows fill:#eeeeff,stroke:#000;
    classDef script fill:#ffccdd,stroke:#000;
```
