-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (51 loc) · 1.59 KB
/
update-assistant.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
env:
ASSISTANT_ID: ${{ vars.ASSISTANT_ID }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
on:
push:
branches:
- main
- "releases/**"
jobs:
deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-build.txt
- name: Build
run: |
python build.py
- name: Safe assistant artifact
uses: actions/upload-artifact@v3
with:
name: assistant
path: ./aicoach/assistant.json
retention-days: 1
- name: Read instructions
id: instructions
uses: juliangruber/read-file-action@v1
with:
path: ./aicoach/assistant.json
- name: Echo instructions
run: echo "${{ steps.instructions.outputs.content }}"
- name: Deploy Assistant
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.openai.com/v1/assistants/${{ vars.ASSISTANT_ID }}"
method: "POST"
bearerToken: ${{ secrets.OPENAI_API_KEY }}
customHeaders: '{"Content-Type": "application/json", "OpenAI-Beta": "assistants=v1"}'
data: ${{ steps.instructions.outputs.content }}
escapeData: "true"
- name: Show Response
run: |
echo ${{ steps.myRequest.outputs.response }}
echo ${{ steps.myRequest.outputs.headers }}