Add SSE transport, Docker CI/CD pipeline, and make mnemonic a per-call parameter
This commit is contained in:
61
.github/workflows/deploy.yml
vendored
Normal file
61
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build TypeScript
|
||||
run: npm run build
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=12288
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:latest
|
||||
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
||||
|
||||
- name: Deploy to Hetzner VM
|
||||
run: |
|
||||
echo "${{ secrets.HETZNER_SSH_KEY }}" > /tmp/deploy_key
|
||||
chmod 600 /tmp/deploy_key
|
||||
ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no \
|
||||
${{ secrets.HETZNER_USER }}@${{ secrets.HETZNER_HOST }} \
|
||||
"echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin && \
|
||||
docker pull ghcr.io/${{ github.repository }}:${{ github.sha }} && \
|
||||
docker stop vector-mcp || true && \
|
||||
docker rm vector-mcp || true && \
|
||||
docker run -d \
|
||||
--name vector-mcp \
|
||||
--restart unless-stopped \
|
||||
-p 3000:3000 \
|
||||
--env-file /etc/vector-mcp/env \
|
||||
ghcr.io/${{ github.repository }}:${{ github.sha }}"
|
||||
rm /tmp/deploy_key
|
||||
Reference in New Issue
Block a user