Skip to content

Commit 4e092bc

Browse files
feat: github actions
1 parent d4c4ba2 commit 4e092bc

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Bun
17+
uses: oven-sh/setup-bun@v2
18+
with:
19+
bun-version: latest
20+
21+
- name: Install dependencies
22+
run: bun install --frozen-lockfile
23+
24+
- name: Initialize content and vector store
25+
run: bun run init
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
# - name: Log in to Docker Hub
31+
# if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN }}
32+
# uses: docker/login-action@v3
33+
# with:
34+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Docker metadata
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: ${{ secrets.DOCKER_IMAGE }}
42+
tags: |
43+
type=raw,value=latest
44+
type=raw,value=gh-${{ github.run_id }}
45+
type=sha,format=short
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v6
49+
with:
50+
context: .
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"mcp-inspect": "mcp-inspector --transport http --server-url http://localhost:1234",
1010
"download-content": "bun run scripts/download-content.js",
1111
"init-vector-store": "bun run scripts/init-vector-store.ts",
12+
"init": "bun run download-content && bun run init-vector-store",
1213
"prepare": "bun run download-content && bun run init-vector-store"
1314
},
1415
"keywords": [],

0 commit comments

Comments
 (0)