Skip to content

Azure function http trigger test #1

Azure function http trigger test

Azure function http trigger test #1

name: Deploy Azure Function
on:
push:
paths:
- 'handlenett-backend/serverless/HttpTriggerTest/**'
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Log in to Azure - App Registration Credentials
uses: azure/login@v1
with:
creds: |
{
"clientId": "${{ secrets.AZURE_CLIENT_ID_PUBLISH_AND_DEPLOY_AR }}",
"clientSecret": "${{ secrets.AZURE_SECRET_ID_PUBLISH_AND_DEPLOY_AR }}",
"subscriptionId": "${{ secrets.AZURE_SUBSCRIPTION_ID }}",
"tenantId": "${{ secrets.AZURE_TENANT_ID }}"
}
- name: Build the function app
run: dotnet publish -c Release -o ./publish
- name: Create deployment package
run: zip -r publish.zip ./publish
- name: Deploy to Azure Function App using Azure CLI
run: |
az functionapp deployment source config-zip \
--resource-group handlenett-rg \
--name handlenett-notifications-fa \
--src ./publish.zip
- name: Clean up published artifacts
run: rm -rf ./publish ./publish.zip