Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandromazza98 committed Jan 18, 2025
1 parent 5462083 commit 6ddeffa
Showing 1 changed file with 6 additions and 43 deletions.
49 changes: 6 additions & 43 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,12 @@ jobs:
# Deploy backend service
echo "Creating backend service..."
BACKEND_JSON='{"name":"'$PR_NAME'-backend","type":"web_service","runtime":"node","buildCommand":"cd backend && npm install && npm run build","startCommand":"cd backend && npm run start","envVars":[{"key":"PORT","value":"3456"}],"ownerId":"'$OWNER_ID'","serviceDetails":{"plan":"free","pullRequestPreviewsEnabled":true,"region":"oregon","env":"node","rootDir":".","numInstances":1,"healthCheckPath":"/health","buildFilter":{"paths":["backend/**"]}},"autoDeploy":"no"}'
BACKEND_RESPONSE=$(curl -X POST https://api.render.com/v1/services \
-H "Authorization: Bearer $RENDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "'$PR_NAME'-backend",
"type": "web_service",
"runtime": "node",
"buildCommand": "cd backend && npm install && npm run build",
"startCommand": "cd backend && npm run start",
"envVars": [
{"key": "PORT", "value": "3456"}
],
"ownerId": "'$OWNER_ID'",
"serviceDetails": {
"plan": "free",
"pullRequestPreviewsEnabled": true,
"region": "oregon",
"env": "node",
"rootDir": ".",
"numInstances": 1,
"healthCheckPath": "/health",
"buildFilter": {
"paths": ["backend/**"]
}
},
"autoDeploy": "no"
}')
-d "$BACKEND_JSON")
echo "Backend service creation response:"
echo "$BACKEND_RESPONSE"
Expand Down Expand Up @@ -179,28 +158,12 @@ jobs:
# Deploy frontend service
echo "Creating frontend service..."
FRONTEND_JSON='{"name":"'$PR_NAME'-frontend","type":"static_site","buildCommand":"cd frontend && npm install && npm run build","publishPath":"frontend/dist","envVars":[{"key":"VITE_BACKEND_URL","value":"'$BACKEND_URL'"}],"ownerId":"'$OWNER_ID'","serviceDetails":{"plan":"free","pullRequestPreviewsEnabled":true,"region":"oregon","buildFilter":{"paths":["frontend/**"]}},"autoDeploy":"no"}'
FRONTEND_RESPONSE=$(curl -X POST https://api.render.com/v1/services \
-H "Authorization: Bearer $RENDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "'$PR_NAME'-frontend",
"type": "static_site",
"buildCommand": "cd frontend && npm install && npm run build",
"publishPath": "frontend/dist",
"envVars": [
{"key": "VITE_BACKEND_URL", "value": "'$BACKEND_URL'"}
],
"ownerId": "'$OWNER_ID'",
"serviceDetails": {
"plan": "free",
"pullRequestPreviewsEnabled": true,
"region": "oregon",
"buildFilter": {
"paths": ["frontend/**"]
}
},
"autoDeploy": "no"
}')
-d "$FRONTEND_JSON")
echo "Frontend service creation response:"
echo "$FRONTEND_RESPONSE"
Expand Down

0 comments on commit 6ddeffa

Please sign in to comment.