Move repcli, refactor #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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 }} |