# pomdap/gb-studio-ci architecture

> Architecture diagram of the GitHub repository pomdap/gb-studio-ci, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pomdap/gb-studio-ci
- Repository: https://github.com/pomdap/gb-studio-ci

## Overview

##### Project type and purpose
- This is a CI‐centric open-source tool: a Docker image (“GB Studio CI”) pre-packaged with GB Studio CLI and related utilities.
- Its purpose is to simplify and standardize the export of GB Studio games in a GitHub Actions pipeline.

##### File structure
- Top-level files:
- Dockerfile – defines how the CI image is built (base OS, installs GB Studio CLI, dependencies).
- package.json – likely used to pin versions of CLI/tools or manage ancillary scripts.
- README.md, LICENSE – documentation and licensing.
- .github/workflows – multiple YAML files that drive:
- building and publishing the Docker image (build-container-image.yml)
- validating new images (check-container-image.yml)
- reacting to upstream GB Studio releases (check-gbstudio-release.yml)
- housekeeping old workflow runs (clean-workflow-runs.yml)
- .vscode – editor configs (not critical to runtime architecture).

##### README for additional insights
- Confirms:
- Supported image tags map to GB Studio versions.
- Typical usage is as a container in a GitHub Actions job where you mount your GB Studio project, invoke `gb-studio-cli make:rom`, then upload artifacts.
- Provides example workflow snippet illustrating container usage, checkout, CLI call, and artifact upload.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Source Code Repository"
        Repo["GitHub Repository"]:::repo
        Dockerfile["Dockerfile"]:::repo
        Package["package.json"]:::repo
        Readme["README.md"]:::repo
        License["LICENSE"]:::repo
        WorkflowsDir[".github/workflows/"]:::repo
        VSCode[".vscode/"]:::repo
        subgraph "Workflows"
            BuildWorkflow["build-container-image.yml"]:::ci
            ValidateWorkflow["check-container-image.yml"]:::ci
            ReleaseWorkflow["check-gbstudio-release.yml"]:::ci
            CleanWorkflow["clean-workflow-runs.yml"]:::ci
        end
    end

    Repo -->|push code| BuildWorkflow
    BuildWorkflow -->|"docker build"| DockerDaemon["Docker Daemon"]:::ci
    Dockerfile -.-> DockerDaemon
    DockerDaemon -->|"docker push"| Registry["Container Registry"]:::registry
    Registry -->|pull image| ValidateWorkflow
    Registry -->|trigger on new GB Studio release| ReleaseWorkflow
    Registry -->|housekeeping triggers| CleanWorkflow

    subgraph "CI Job Container Execution"
        ContainerImage["pomdap/gb-studio-ci:<tag>"]:::container
        Workspace["Project Workspace (mounted)"]:::repo
        ROM["Game ROM & Web Build"]:::artifact
        ArtifactStore["GitHub Actions Artifacts"]:::artifact
    end

    Registry -->|pull| ContainerImage
    ContainerImage -->|"actions/checkout mount"| Workspace
    ContainerImage -->|"gb-studio-cli make:rom"| ROM
    ROM -->|"upload-artifact"| ArtifactStore

    click Dockerfile "https://github.com/pomdap/gb-studio-ci/tree/main/Dockerfile"
    click Package "https://github.com/pomdap/gb-studio-ci/blob/main/package.json"
    click Readme "https://github.com/pomdap/gb-studio-ci/blob/main/README.md"
    click License "https://github.com/pomdap/gb-studio-ci/tree/main/LICENSE"
    click WorkflowsDir "https://github.com/pomdap/gb-studio-ci/tree/main/.github/workflows/"
    click BuildWorkflow "https://github.com/pomdap/gb-studio-ci/blob/main/.github/workflows/build-container-image.yml"
    click ValidateWorkflow "https://github.com/pomdap/gb-studio-ci/blob/main/.github/workflows/check-container-image.yml"
    click ReleaseWorkflow "https://github.com/pomdap/gb-studio-ci/blob/main/.github/workflows/check-gbstudio-release.yml"
    click CleanWorkflow "https://github.com/pomdap/gb-studio-ci/blob/main/.github/workflows/clean-workflow-runs.yml"
    click VSCode "https://github.com/pomdap/gb-studio-ci/tree/main/.vscode/"

    classDef repo fill:#D0E4F5,stroke:#0366d6,color:#0366d6;
    classDef ci fill:#DFF5D0,stroke:#28a745,color:#28a745;
    classDef registry fill:#FFE5B4,stroke:#FB8C00,color:#FB8C00;
    classDef container fill:#FFF4C1,stroke:#f0c419,color:#f0c419;
    classDef artifact fill:#E8DAF5,stroke:#9b59b6,color:#9b59b6;
```
