Skip to content

Merge pull request #661 from subquery/sandbox-differences #60

Merge pull request #661 from subquery/sandbox-differences

Merge pull request #661 from subquery/sandbox-differences #60

Workflow file for this run

name: Deploy RAG Data - academy.subquery.network
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "2.2.2"
cache: pnpm
- name: Install subql-ai
run: deno install -g -f --allow-env --allow-sys --allow-net --allow-import --allow-read --allow-write --allow-ffi --allow-run --unstable-worker-options --no-prompt -n subql-ai jsr:@subql/ai-app-framework/cli
- name: Extract cache
run: tar -xzvf db-openai.tar.gz
- name: Build rag
run: subql-ai embed -i docs -o dist -t subql-docs --model text-embedding-3-large --openAiApiKey $OPENAI_API_KEY
- name: Tar dist
run: tar -czvf db-openai.tar.gz dist
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
add_options: "--all"
commit_message: "Submit Build Rag Data"
skip_checkout: true
branch: build-rag
commit_options: "--no-verify --signoff"
push_options: "--force"
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
- name: Redeploy subquery-ai
run: |
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/onfinalitydev/pipeline-ai/pipelines' \
--header 'Authorization: Bearer ${{ secrets.BITBUCKET_ACCESS_TOKEN }}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"target": {
"selector": {
"type": "custom",
"pattern": "only-redeploy"
},
"type": "pipeline_ref_target",
"ref_name": "main",
"ref_type": "branch"
}
}'