|
73 | 73 | - name: Deploy editor to App Service (container) |
74 | 74 | if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }} |
75 | 75 | run: | |
76 | | - az webapp config container set --name ${{ secrets.EDITOR_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --docker-custom-image-name ${{ needs.build-and-push.outputs.registry }}/app-scripting-editor:latest |
| 76 | + # Deploy the API image to the public editor App Service so the same hostname serves the SPA and the /api endpoints. |
| 77 | + az webapp config container set --name ${{ secrets.EDITOR_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --docker-custom-image-name ${{ needs.build-and-push.outputs.registry }}/app-scripting-editor-api:latest |
| 78 | +
|
| 79 | + - name: Set WEBSITES_PORT for editor (public) app |
| 80 | + if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }} |
| 81 | + run: | |
| 82 | + echo "Setting WEBSITES_PORT=4000 for ${{ secrets.EDITOR_APP_NAME }}" |
| 83 | + az webapp config appsettings set --name ${{ secrets.EDITOR_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --settings WEBSITES_PORT=4000 |
77 | 84 |
|
78 | 85 | - name: Deploy editor-api to App Service (container) |
79 | 86 | if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }} |
@@ -103,3 +110,21 @@ jobs: |
103 | 110 | echo "ERROR: editor-api did not become healthy" |
104 | 111 | az webapp log tail --name ${{ secrets.EDITOR_API_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} & |
105 | 112 | exit 1 |
| 113 | +
|
| 114 | + - name: Smoke test public editor app |
| 115 | + if: ${{ steps.check-secrets.outputs.deploy_ready == 'true' }} |
| 116 | + run: | |
| 117 | + host=$(az webapp show --name ${{ secrets.EDITOR_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --query defaultHostName -o tsv) |
| 118 | + echo "Testing https://$host/api/health" |
| 119 | + for i in 1 2 3 4 5 6 7 8 9 10; do |
| 120 | + status=$(curl -s -o /dev/null -w "%{http_code}" "https://$host/api/health" || echo "000") |
| 121 | + if [ "$status" = "200" ]; then |
| 122 | + echo "OK: public editor health returned 200" |
| 123 | + exit 0 |
| 124 | + fi |
| 125 | + echo "Attempt $i: status=$status; retrying in 5s..." |
| 126 | + sleep 5 |
| 127 | + done |
| 128 | + echo "ERROR: public editor did not become healthy" |
| 129 | + az webapp log tail --name ${{ secrets.EDITOR_APP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} & |
| 130 | + exit 1 |
0 commit comments