Skip to content

Update OpenAI Vector Store #16

Update OpenAI Vector Store

Update OpenAI Vector Store #16

name: Update OpenAI Vector Store
on:
push:
branches: [main]
paths:
- "openapi.yml"
# - "asyncapi.yml"
workflow_dispatch:
inputs:
force_update:
description: "Force update all files regardless of changes"
required: false
default: false
type: boolean
jobs:
update-vector-store:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TIGRIS_ACCESS_KEY_ID }}
AWS_ENDPOINT_URL: ${{ secrets.TIGRIS_ENDPOINT_URL }}
AWS_REGION: ${{ secrets.TIGRIS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TIGRIS_SECRET_ACCESS_KEY }}
BUCKET_NAME: ${{ secrets.TIGRIS_BUCKET_NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Create .deepgram directory
run: mkdir -p .deepgram/metadata
- name: Download previous vectorstore metadata from S3
uses: urbann3/s3go-action@v1
continue-on-error: true
with:
mode: download
bucket: ${{ env.BUCKET_NAME }}
prefix: ${{ github.repository }}/.deepgram/
localPath: ./
concurrency: 10
queueSize: 100
- name: Verify metadata download
run: |
if [ -f .deepgram/metadata/vectorstore_metadata.json ]; then
echo "✅ Successfully downloaded metadata from S3 for repository: ${{ github.repository }}"
echo "File contents preview:"
head -20 .deepgram/metadata/vectorstore_metadata.json || true
else
echo "⚠️ No existing metadata found in S3 for repository: ${{ github.repository }} - will start fresh"
fi
- name: Create output directories
run: mkdir -p tmp/openapi tmp/asyncapi
- name: Generate OpenAPI documentation with Deepgram CLI
run: |
npx -y @deepgram/deepdown-cli@latest build openapi.yml \
.deepgram/openapi.deepdown -o tmp/openapi/ --resolve-refs --resolve-security
# - name: Generate AsyncAPI documentation with Deepgram CLI
# run: |
# npx -y @deepgram/deepdown-cli@latest build asyncapi.yml \
# .deepgram/asyncapi.deepdown -o tmp/asyncapi/ --resolve-refs --resolve-security
- name: Make vectorize script executable
run: chmod +x .deepgram/vectorize
- name: Upload all files to Vector Store
run: |
node .deepgram/vectorize tmp/
env:
CI: true
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY_VECTOR_MGMT }}
- name: Upload vectorize metadata to S3
if: always() && hashFiles('.deepgram/metadata/vectorstore_metadata.json') != ''
uses: urbann3/s3go-action@v1
with:
mode: upload
bucket: ${{ env.BUCKET_NAME }}
prefix: ${{ github.repository }}/
localPath: .deepgram/
concurrency: 10
queueSize: 100