How garnercorp/build-actions works
Project Type & Purpose
• Project Type: A library of modular GitHub Actions and workflows.
• Purpose: To provide a suite of automated tasks for building, testing, publishing images, managing versioning, and integration tasks (such as secret scanning, spelling checks, and notifications) as part of the CI/CD processes.
Analyzing the File Structure
• The .github directory contains configurations for actions and workflows – indicating that the project is tightly integrated with GitHub’s continuous integration system.
• There are numerous top-level directories each representing a different action: for example, “yarn”, “scala”, “deploy”, “image”, “release”, “scoverage”, “bump-version”, etc. These are separate functional components.
• Additional directories (e.g., “scripts”) provide auxiliary tooling/scripts that support the actions.
• The presence of workflow YAML files in .github/workflows shows how the actions are orchestrated into pipeline tasks (e.g., secret scanning, formatting with scalafmt, and spelling checks).
Key Components
a. GitHub Workflows & Triggers:
• Centralized orchestration (e.g., workflows such as detect-new-secrets.yml, scalafmt.yml, spelling.yml) that launch the individual actions.
• These workflows are the “command centers” that call each action.
b. Individual GitHub Actions:
• Each folder (like “yarn”, “scala”, “deploy”, “image”, “release”, “scoverage”, “bump-version”, “kind-logs”, “docker-logs”, “configure-google-docker”, “tag-images”, “copy-image”, “google-k8s-pull-secrets”, “notify-slack”) should be modeled as distinct components.
c. Supporting Scripts & Tools:
• The “scripts” directory contains command scripts that assist in tasks like Docker builds, reporting, or matching logs.
• These might be shown as helper modules/services that are invoked by some actions.
d. External Services & Dependencies:
• Integrations with external systems:
• Docker Registry (for image building and publishing)
• Google Kubernetes Services (via actions like google-k8s-pull-secrets and configure-google-docker)
• Slack (via notify-slack) for notifications.
• If there are any external linters, secret scanners, or language-specific compilers (like Scala), note them.
Architectural Patterns & Relationships
• The project follows a modular/microservice-like design within the CI/CD ecosystem:
• Each GitHub Action works as an independent module.
• They are orchestrated together via GitHub workflows, meaning there’s a clear separation of concerns.
• Dependencies flow from upstream actions (e.g., compiling/building with “scala” and “yarn”) to downstream actions (e.g., “release”, “deploy” and “image” actions).
• Directional flow: For example, a “build” component might trigger “version bump” and then trigger “deploy” workflows.