Merge pull request #9036 from continuedev/nate/runloop-blueprint-upload-workflow

Add GitHub workflow to upload Runloop blueprint on changes
This commit is contained in:
Nate Sesti 2025-12-05 17:38:23 -08:00 • committed by GitHub
commit c7106952d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 61 additions and 4 deletions

View file

@ -9,11 +9,9 @@
],
"launch_parameters": {
"launch_commands": [
"export DISPLAY=:99",
"nohup Xvfb :99 -screen 0 1920x1080x24 > /tmp/xvfb.log 2>&1 &",
"sleep 2"
],
"environment_variables": {
"DISPLAY": ":99"
}
]
}
}

View file

@ -0,0 +1,59 @@
name: Upload Runloop Blueprint
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/runloop-blueprint-template.json'
permissions:
contents: read
jobs:
upload-blueprint:
name: Upload Blueprint to Runloop
runs-on: ubuntu-latest
# Only run this workflow on the main repository (continuedev/continue)
if: github.repository == 'continuedev/continue'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Publish Blueprint to Runloop
env:
RUNLOOP_API_KEY: ${{ secrets.RUNLOOP_API_KEY }}
run: |
echo "Publishing blueprint 'cn' to Runloop API"
# Use blueprint configuration from template file
cp .github/workflows/runloop-blueprint-template.json blueprint.json
# Publish to Runloop API
response=$(curl -X POST "https://api.runloop.ai/v1/blueprints" \
-H "Authorization: Bearer $RUNLOOP_API_KEY" \
-H "Content-Type: application/json" \
-d @blueprint.json \
-w "%{http_code}" \
-s)
http_code=$(echo "$response" | tail -c 4)
response_body=$(echo "$response" | head -c -4)
if [[ "$http_code" == "200" ]] || [[ "$http_code" == "201" ]]; then
echo "✅ Successfully published blueprint to Runloop API"
echo "Response: $response_body"
# Extract blueprint ID if available
blueprint_id=$(echo "$response_body" | jq -r '.id // empty')
if [[ -n "$blueprint_id" ]]; then
echo "Blueprint ID: $blueprint_id"
echo "blueprint_id=$blueprint_id" >> $GITHUB_OUTPUT
fi
else
echo "❌ Failed to publish blueprint to Runloop API"
echo "HTTP Code: $http_code"
echo "Response: $response_body"
exit 1
fi