Skip to content

Commit 50fa7e9

Browse files
committed
ci: add ci workflow config
1 parent c9a69dd commit 50fa7e9

File tree

6 files changed

+249
-0
lines changed

6 files changed

+249
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: 'Build & Push Docker'
2+
3+
inputs:
4+
compose-version:
5+
description: 'Docker Compose version'
6+
default: 2.6.0
7+
registry:
8+
description: 'Docker registry service'
9+
default: ghcr.io
10+
username:
11+
description: 'Username for https://ghcr.io'
12+
required: true
13+
password:
14+
description: 'Password for https://ghcr.io'
15+
required: true
16+
image:
17+
description: 'Image name with provider url'
18+
required: true
19+
dockerfile:
20+
description: 'Path to the Dockerfile'
21+
required: true
22+
context:
23+
description: 'Path to the Context'
24+
default: .
25+
required: true
26+
build-args:
27+
description: 'List of build-time variables'
28+
required: false
29+
30+
outputs:
31+
image:
32+
description: 'Image url'
33+
value: ${{ steps.imageOuput.outputs.imageUrl }}
34+
imageid:
35+
description: 'Image ID'
36+
value: ${{ steps.publish.outputs.imageId }}
37+
digest:
38+
description: 'Image digest'
39+
value: ${{ steps.publish.outputs.digest }}
40+
metadata:
41+
description: 'Build result metadata'
42+
value: ${{ steps.publish.outputs.metadata }}
43+
44+
runs:
45+
using: 'composite'
46+
steps:
47+
- name: Log in to the ghcr.io registry
48+
uses: docker/login-action@v2
49+
with:
50+
registry: ${{ inputs.registry }}
51+
username: ${{ inputs.username }}
52+
password: ${{ inputs.password }}
53+
54+
- name: Docker meta
55+
id: meta
56+
uses: docker/metadata-action@v3
57+
with:
58+
images: |
59+
${{ inputs.image }}
60+
tags: |
61+
type=ref,event=branch
62+
type=sha,prefix=
63+
type=semver,pattern={{raw}}
64+
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v1
67+
68+
- name: Build and push the image to ghcr.io
69+
uses: docker/build-push-action@v4
70+
id: publish
71+
with:
72+
context: ${{ inputs.context }}
73+
file: ${{ inputs.dockerfile }}
74+
push: true
75+
tags: ${{ steps.meta.outputs.tags }}
76+
labels: ${{ steps.meta.outputs.labels }}
77+
build-args: ${{ inputs.build-args }}
78+
cache-from: type=registry,ref=${{ inputs.image }}-cache
79+
cache-to: type=registry,ref=${{ inputs.image }}-cache,mode=max
80+
- id: imageOuput
81+
shell: bash
82+
run: |
83+
echo "imageUrl=${{ fromJSON(steps.publish.outputs.metadata)['image.name'] }}" >> $GITHUB_OUTPUT
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and publish Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize]
9+
release:
10+
types: [published]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-and-publish-image:
18+
runs-on: buildjet-4vcpu-ubuntu-2204
19+
if: |
20+
(github.event_name == 'release' && github.event.action == 'published') ||
21+
github.ref == 'refs/heads/main' ||
22+
(github.event_name == 'pull_request' &&
23+
github.event.pull_request.head.repo.full_name == github.repository)
24+
permissions:
25+
contents: read
26+
packages: write
27+
28+
outputs:
29+
docs-changed: ${{ steps.check-docs.outputs.docs-changed }}
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 2
35+
36+
- name: Check for docs changes
37+
id: check-docs
38+
run: |
39+
if git diff --name-only HEAD~1 HEAD | grep -q "^docs/"; then
40+
echo "docs-changed=true" >> $GITHUB_OUTPUT
41+
else
42+
echo "docs-changed=false" >> $GITHUB_OUTPUT
43+
fi
44+
45+
- name: Build and push app image
46+
uses: ./.github/actions/docker-publish
47+
id: publish-app
48+
with:
49+
username: ${{ github.repository_owner }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
image: ghcr.io/fuellabs/fuel-mcp-server
52+
dockerfile: deployment/Dockerfile
53+
context: .
54+
55+
- name: Build and push indexer image
56+
if: steps.check-docs.outputs.docs-changed == 'true'
57+
uses: ./.github/actions/docker-publish
58+
id: publish-indexer
59+
with:
60+
username: ${{ github.repository_owner }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
image: ghcr.io/fuellabs/fuel-mcp-server-indexer
63+
dockerfile: deployment/Dockerfile.indexer
64+
context: .

.github/workflows/helm-publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and publish Helm Chart
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'helm/fuel-mcp-server/Chart.yaml'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
helm-release:
15+
name: Build Helm Chart
16+
runs-on: buildjet-4vcpu-ubuntu-2204
17+
if: |
18+
(github.event_name == 'release' && github.event.action == 'published') ||
19+
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Check out code
26+
uses: actions/checkout@v3
27+
28+
- name: Package and Push Charts
29+
uses: bsord/helm-push@v4.1.0
30+
with:
31+
useOCIRegistry: true
32+
registry-url: oci://ghcr.io/fuellabs/helmcharts
33+
username: ${{ github.repository_owner }}
34+
access-token: ${{ secrets.GITHUB_TOKEN }}
35+
force: true
36+
chart-folder: ./helm/fuel-mcp-server

.github/workflows/pr.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "PR Checks"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, edited, closed]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
validate-title:
13+
name: Validate PR Title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: amannn/action-semantic-pull-request@v4
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
audit:
21+
name: Audit
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: oven-sh/setup-bun@v1
26+
with:
27+
bun-version: latest
28+
- run: bun install
29+
- run: bun audit
30+
31+
test:
32+
name: Test
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: oven-sh/setup-bun@v1
37+
with:
38+
bun-version: latest
39+
- run: bun install
40+
- run: bun test
41+
- run: bun run lint || true
42+
- run: bun run typecheck || true

bunfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[install]
2+
optional = false

deployment/entrypoint.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
INDEX_PATH="./vectra_index"
6+
7+
echo "Starting Fuel MCP Server..."
8+
9+
# Verify index exists (should be created by init container)
10+
if [ -d "$INDEX_PATH" ] && [ -f "$INDEX_PATH/index.json" ] && [ -s "$INDEX_PATH/index.json" ]; then
11+
echo "Vector index found at $INDEX_PATH"
12+
else
13+
echo "Vector index not found at $INDEX_PATH"
14+
echo "This indicates the init container failed to create the index."
15+
echo "Check init container logs for indexing errors."
16+
exit 1
17+
fi
18+
19+
# Start the server
20+
echo "Starting HTTP server on port 3500..."
21+
export VECTRA_INDEX_PATH="$INDEX_PATH"
22+
exec bun run src/cli.ts --transport http --port 3500

0 commit comments

Comments
 (0)