feat(gb-infra): Add CI/CD workflow for Rust with build, test, and deployment steps; include architecture diagram for system components

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-04-27 16:21:08 -03:00
parent bf382e623e
commit b2868c6d5d
3 changed files with 130 additions and 0 deletions

View file

@ -0,0 +1,52 @@
name: gbserver Rust CI/CD
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-deploy:
runs-on: gbo
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release
- name: Deploy binary
run: |
sudo cp ./target/release/gbserver /opt/gbo/bin/bot
sudo chmod +x /opt/gbo/bin/bot/gbserver
sudo systemctl restart gbserver

BIN
gb-infra/architecture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

78
gb-infra/architecture.txt Normal file
View file

@ -0,0 +1,78 @@
flowchart TB
%% Style definitions
classDef users fill:#FF9900,stroke:#FF6600,stroke-width:2px,color:white,font-weight:bold
classDef identity fill:#4285F4,stroke:#2956B2,stroke-width:2px,color:white,font-weight:bold
classDef content fill:#0F9D58,stroke:#0B8043,stroke-width:2px,color:white,font-weight:bold
classDef communication fill:#DB4437,stroke:#B31412,stroke-width:2px,color:white,font-weight:bold
classDef ai fill:#9C27B0,stroke:#7B1FA2,stroke-width:2px,color:white,font-weight:bold
classDef bot fill:#FB8C00,stroke:#EF6C00,stroke-width:2px,color:white,font-weight:bold
%% Main user node
User((👤 Users))
subgraph "Identity & Access Management"
Zitadel["🔐 Identity Provider<br>(Zitadel)"]
Stalwart["✉️ Mail Server<br>(Stalwart)"]
end
subgraph "Content & Collaboration"
Forgejo["📊 ALM Server<br>(Forgejo)"]
Static["🌐 Static Site Generator<br>(Website Static)"]
Minio["💾 Object Storage<br>(MinIO)"]
end
subgraph "Communication & Delivery"
Caddy["🔄 Reverse Proxy<br>(Caddy)"]
LiveKit["💬 Real-time Communication<br>(LiveKit)"]
end
subgraph "AI & Integration Layer"
LLM["🧠 LLM Engine<br>(Nomic LLM)"]
subgraph "Bot Framework"
BotFramework["🤖 Bot Framework"]
subgraph "Bot Capabilities"
MCP["📨 Message Control Protocol<br>(MCP)"]
GET["🔗 GET Web Service Calls"]
BASIC["⚙️ BASIC Engine"]
end
end
end
%% Connection lines with colors
User --> |"User Access"| Caddy
Caddy --> |"Auth"| Zitadel
Caddy --> |"Code & Issues"| Forgejo
Caddy --> |"Content"| Static
Caddy --> |"Real-time"| LiveKit
Caddy --> |"AI & Bots"| BotFramework
Zitadel --> |"SSO"| Forgejo
Zitadel --> |"Auth"| LiveKit
Zitadel --> |"Identity"| BotFramework
Forgejo --> |"Store"| Minio
Static --> |"Assets"| Minio
BotFramework --> MCP
BotFramework --> GET
BotFramework --> BASIC
BotFramework --> |"NLP"| LLM
Stalwart --> |"Email"| BotFramework
LiveKit --> |"Messaging"| BotFramework
%% Integration flows - dashed lines with colors
MCP -.-> |"Message Routing"| Stalwart
GET -.-> |"API Calls"| Forgejo
BASIC -.-> |"Scripting"| Minio
LLM -.-> |"Content Generation"| Static
%% Apply styles
class User users
class Zitadel,Stalwart identity
class Forgejo,Static,Minio content
class Caddy,LiveKit communication
class LLM ai
class BotFramework,MCP,GET,BASIC bot