diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 39ba276..7023253 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -45,31 +45,65 @@ jobs: with: azcliversion: latest inlineScript: | - # Update with unique revision suffix to force new revision SUFFIX=$(echo "${{ github.sha }}" | cut -c1-8) + + # Update image AND ensure minReplicas=1 so the container actually starts. + # Without --min-replicas 1, Azure scales to zero and the bot never boots. az containerapp update \ --name ${{ env.CONTAINER_APP_NAME }} \ --resource-group ${{ env.RESOURCE_GROUP }} \ --image ${{ secrets.ACR_LOGIN_SERVER }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \ - --revision-suffix "deploy-${SUFFIX}" + --revision-suffix "deploy-${SUFFIX}" \ + --min-replicas 1 \ + --max-replicas 1 - name: Verify deployment uses: azure/cli@v2 with: azcliversion: latest inlineScript: | - # Wait for new revision to be active, then restart if needed - sleep 10 + sleep 15 + + # Get the revision we just deployed (sorted by creation date, newest first) + EXPECTED_SUFFIX="deploy-$(echo "${{ github.sha }}" | cut -c1-8)" LATEST_REVISION=$(az containerapp revision list \ --name ${{ env.CONTAINER_APP_NAME }} \ --resource-group ${{ env.RESOURCE_GROUP }} \ - --query "[0].name" -o tsv) + --query "sort_by(@, &properties.createdTime) | [-1].name" -o tsv) echo "Latest revision: $LATEST_REVISION" + + # Check provisioning state + STATE=$(az containerapp revision show \ + --name ${{ env.CONTAINER_APP_NAME }} \ + --resource-group ${{ env.RESOURCE_GROUP }} \ + --revision "$LATEST_REVISION" \ + --query "properties.runningState" -o tsv 2>/dev/null || echo "unknown") + echo "Revision state: $STATE" + + # Activate revision if not running, then restart + if [ "$STATE" != "Running" ]; then + echo "Revision not running yet, activating..." + az containerapp revision activate \ + --name ${{ env.CONTAINER_APP_NAME }} \ + --resource-group ${{ env.RESOURCE_GROUP }} \ + --revision "$LATEST_REVISION" || true + sleep 5 + fi + az containerapp revision restart \ --name ${{ env.CONTAINER_APP_NAME }} \ --resource-group ${{ env.RESOURCE_GROUP }} \ --revision "$LATEST_REVISION" || true + # Final status check + sleep 10 + REPLICAS=$(az containerapp revision show \ + --name ${{ env.CONTAINER_APP_NAME }} \ + --resource-group ${{ env.RESOURCE_GROUP }} \ + --revision "$LATEST_REVISION" \ + --query "properties.replicas" -o tsv 2>/dev/null || echo "0") + echo "Running replicas: $REPLICAS" + - name: Summary run: | echo "### Deployed successfully! :rocket:" >> $GITHUB_STEP_SUMMARY diff --git a/nyla-marketing.html b/nyla-marketing.html index 704394f..64c67aa 100644 --- a/nyla-marketing.html +++ b/nyla-marketing.html @@ -120,7 +120,7 @@ footer .logo-img{height:26px;margin-bottom:6px} @@ -243,7 +243,7 @@ footer .logo-img{height:26px;margin-bottom:6px} Zero IT setup at your end × - × + Partial × @@ -283,7 +283,7 @@ footer .logo-img{height:26px;margin-bottom:6px} Works with any organization Admin needed - App install + Partial × @@ -304,7 +304,7 @@ footer .logo-img{height:26px;margin-bottom:6px}