Skip to content

Commit f2a71e0

Browse files
feat(ci): update ci for cd (#12)
1 parent 7722027 commit f2a71e0

File tree

12 files changed

+217
-146
lines changed

12 files changed

+217
-146
lines changed

.github/workflows/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v3
29+
with:
30+
version: 9.10.0
31+
32+
- name: Get pnpm store directory
33+
id: pnpm-cache
34+
shell: bash
35+
run: |
36+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
38+
- name: Setup pnpm cache
39+
uses: actions/cache@v4
40+
with:
41+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
42+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') || github.sha }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-store-
45+
46+
- name: Install dependencies
47+
run: pnpm install
48+
49+
- name: Install turbo
50+
run: pnpm add turbo@latest -g
51+
52+
- name: Build
53+
run: turbo build

.github/workflows/generate-embeddings.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache@v4
4141
with:
4242
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') || github.sha }}
4444
restore-keys: |
4545
${{ runner.os }}-pnpm-store-
4646
@@ -69,35 +69,43 @@ jobs:
6969
mkdir -p packages/agents
7070
cat > packages/agents/config.toml << 'EOL'
7171
[API_KEYS]
72-
OPENAI = "${{ secrets.OPENAI_API_KEY }}"
73-
GROQ = "${{ secrets.GROQ_API_KEY }}"
74-
ANTHROPIC = "${{ secrets.ANTHROPIC_API_KEY }}"
75-
DEEPSEEK = "${{ secrets.DEEPSEEK_API_KEY }}"
76-
GEMINI = "${{ secrets.GEMINI_API_KEY }}"
77-
78-
[API_ENDPOINTS]
79-
OLLAMA = "${{ secrets.OLLAMA_ENDPOINT }}"
72+
OPENAI = "${{ secrets.OPENAI }}"
73+
ANTHROPIC = "${{ secrets.ANTHROPIC }}"
74+
GEMINI = "${{ secrets.GEMINI }}"
8075
8176
[VECTOR_DB]
82-
MONGODB_URI = "${{ secrets.MONGODB_URI }}"
83-
DB_NAME = "${{ secrets.DB_NAME }}"
84-
COLLECTION_NAME = "${{ secrets.COLLECTION_NAME }}"
77+
POSTGRES_USER = "${{ secrets.POSTGRES_USER }}"
78+
POSTGRES_HOST = "postgres"
79+
POSTGRES_ROOT_DB = "${{ secrets.POSTGRES_ROOT_DB }}"
80+
POSTGRES_PASSWORD = "${{ secrets.POSTGRES_PASSWORD }}"
81+
POSTGRES_PORT = "${{ secrets.POSTGRES_PORT }}"
8582
8683
[GENERAL]
8784
PORT = 3001
8885
SIMILARITY_MEASURE = "cosine"
8986
90-
[PROVIDERS]
91-
DEFAULT_CHAT_PROVIDER = "${{ secrets.DEFAULT_CHAT_PROVIDER }}"
92-
DEFAULT_CHAT_MODEL = "${{ secrets.DEFAULT_CHAT_MODEL }}"
93-
DEFAULT_FAST_CHAT_PROVIDER = "${{ secrets.DEFAULT_FAST_CHAT_PROVIDER }}"
94-
DEFAULT_FAST_CHAT_MODEL = "${{ secrets.DEFAULT_FAST_CHAT_MODEL }}"
95-
DEFAULT_EMBEDDING_PROVIDER = "${{ secrets.DEFAULT_EMBEDDING_PROVIDER }}"
96-
DEFAULT_EMBEDDING_MODEL = "${{ secrets.DEFAULT_EMBEDDING_MODEL }}"
87+
[HOSTED_MODE]
88+
DEFAULT_CHAT_PROVIDER = "gemini"
89+
DEFAULT_CHAT_MODEL = "Gemini Flash 2.5"
90+
DEFAULT_FAST_CHAT_PROVIDER = "gemini"
91+
DEFAULT_FAST_CHAT_MODEL = "Gemini Flash 2.5"
92+
DEFAULT_EMBEDDING_PROVIDER = "openai"
93+
DEFAULT_EMBEDDING_MODEL = "Text embedding 3 large"
9794
9895
[VERSIONS]
99-
STARKNET_FOUNDRY = "${{ secrets.STARKNET_FOUNDRY_VERSION }}"
100-
SCARB = "${{ secrets.SCARB_VERSION }}"
96+
STARKNET_FOUNDRY = "0.37.0"
97+
SCARB = "2.9.2"
98+
EOL
99+
100+
- name: Create env file
101+
run: |
102+
mkdir -p packages/agents
103+
cat > packages/agents/.env << 'EOL'
104+
POSTGRES_USER = "${{ secrets.POSTGRES_USER }}"
105+
POSTGRES_HOST = "localhost"
106+
POSTGRES_ROOT_DB = "${{ secrets.POSTGRES_ROOT_DB }}"
107+
POSTGRES_PASSWORD = "${{ secrets.POSTGRES_PASSWORD }}"
108+
POSTGRES_PORT = "${{ secrets.POSTGRES_PORT }}"
101109
EOL
102110
103111
- name: Generate embeddings
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and push docker images
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_BASE: ${{ github.repository }}
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
component: [backend, ingester]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE }}/${{ matrix.component }}
41+
tags: |
42+
type=ref,event=branch
43+
type=sha,format=short
44+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
45+
46+
- name: Build and push Docker image
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
push: true
51+
file: ./${{ matrix.component }}.dockerfile
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max

.github/workflows/trunk-check.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Trunk check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
permissions: read-all
14+
15+
jobs:
16+
trunk_check:
17+
name: Trunk Code Quality Runner
18+
runs-on: ubuntu-latest
19+
permissions:
20+
checks: write # For trunk to post annotations
21+
contents: read # For repo checkout
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Trunk Code Quality
28+
uses: trunk-io/trunk-action@v1

.trunk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
*tools
6+
plugins
7+
user_trunk.yaml
8+
user.yaml
9+
tmp

.trunk/configs/.hadolint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Following source doesn't work in most setups
2+
ignored:
3+
- SC1090
4+
- SC1091

.trunk/configs/.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Prettier friendly markdownlint config (all formatting rules disabled)
2+
extends: markdownlint/style/prettier

.trunk/configs/.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
quoted-strings:
3+
required: only-when-needed
4+
extra-allowed: ['{|}']
5+
key-duplicates: {}
6+
octal-values:
7+
forbid-implicit-octal: true

0 commit comments

Comments
 (0)