Skip to content

Commit

Permalink
fixed workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrouk committed Nov 26, 2024
1 parent 0d53b97 commit 112f914
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/cli-commands-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:

- name: Run agenta variant serve
run: |
APP_NAME=$(cat app_name.txt)
agenta variant serve --file_name app.py 2>&1 | tee serve_output.log
working-directory: examples/deprecated_sdk_v2/baby_name_generator
shell: bash
Expand All @@ -60,6 +61,21 @@ jobs:
shell: bash
continue-on-error: false

- name: Remove variant using backend API
run: |
APP_NAME=$(cat app_name.txt)
VARIANT_NAME="app.py"
BACKEND_URL="${{ secrets.BACKEND_HOST }}"
# Get the variant ID using the app name and variant name
VARIANT_ID=$(curl -s "${BACKEND_URL}/api/variants/by-name/${APP_NAME}/${VARIANT_NAME}" | jq -r '.id')
# Remove the variant using the backend API
curl -X DELETE "${BACKEND_URL}/api/variants/${VARIANT_ID}/"
working-directory: examples/deprecated_sdk_v2/baby_name_generator
shell: bash
continue-on-error: false

serve-to-cloud:
runs-on: ubuntu-latest
environment: oss
Expand Down Expand Up @@ -95,6 +111,7 @@ jobs:

- name: Run agenta variant serve
run: |
APP_NAME=$(cat app_name.txt)
agenta variant serve --file_name app.py 2>&1 | tee serve_output.log
working-directory: examples/deprecated_sdk_v2/baby_name_generator
shell: bash
Expand All @@ -113,3 +130,19 @@ jobs:
working-directory: examples/deprecated_sdk_v2/baby_name_generator
shell: bash
continue-on-error: false

- name: Remove variant using backend API
run: |
APP_NAME=$(cat app_name.txt)
VARIANT_NAME="app.py"
BACKEND_URL="https://cloud.agenta.ai"
API_KEY="${{ secrets.AGENTA_API_KEY }}"
# Get the variant ID using the app name and variant name
VARIANT_ID=$(curl -s -H "Authorization: ApiKey ${API_KEY}" "${BACKEND_URL}/api/variants/by-name/${APP_NAME}/${VARIANT_NAME}" | jq -r '.id')
# Remove the variant using the backend API
curl -X DELETE -H "Authorization: ApiKey ${API_KEY}" "${BACKEND_URL}/api/variants/${VARIANT_ID}/"
working-directory: examples/deprecated_sdk_v2/baby_name_generator
shell: bash
continue-on-error: false

0 comments on commit 112f914

Please sign in to comment.