Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 7 additions & 26 deletions .github/workflows/deploy-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,11 @@ jobs:
cd deploy
npm install --omit=dev --ignore-scripts

# Create deployment zip
- name: Create deployment package
run: cd deploy && zip -r ../deploy.zip .

# Deploy using Azure CLI (avoids Kudu zipdeploy issues)
# Deploy the prepared folder to Azure Functions
- name: Deploy to Azure Functions
run: |
# Extract SCM credentials from publish profile
PUBLISH_PROFILE='${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}'
SCM_USER=$(echo "$PUBLISH_PROFILE" | grep -o 'userName="[^"]*"' | head -1 | sed 's/userName="//;s/"//')
SCM_PASS=$(echo "$PUBLISH_PROFILE" | grep -o 'userPWD="[^"]*"' | head -1 | sed 's/userPWD="//;s/"//')
SCM_URL=$(echo "$PUBLISH_PROFILE" | grep -o 'publishUrl="[^"]*"' | head -1 | sed 's/publishUrl="//;s/"//')

echo "Deploying to https://${SCM_URL}/api/publish..."
HTTP_STATUS=$(curl -s -o /dev/stderr -w "%{http_code}" \
-X POST "https://${SCM_URL}/api/publish" \
-u "${SCM_USER}:${SCM_PASS}" \
-H "Content-Type: application/zip" \
--data-binary @deploy.zip)

echo "HTTP Status: ${HTTP_STATUS}"
if [ "$HTTP_STATUS" -ge 200 ] && [ "$HTTP_STATUS" -lt 300 ]; then
echo "Deployment successful!"
else
echo "Deployment failed with status ${HTTP_STATUS}"
exit 1
fi
uses: Azure/functions-action@v1.5.3
with:
app-name: fn-info-embalse-prod
package: deploy
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
sku: flexconsumption