diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml new file mode 100644 index 00000000..e3c94f1b --- /dev/null +++ b/.github/workflows/deploy-backend.yml @@ -0,0 +1,33 @@ +name: Deploy Backend (Azure Functions) + +on: + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + name: Build and Deploy Backend + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore src/Backend/AutopilotMonitor.Functions/AutopilotMonitor.Functions.csproj + + - name: Build + run: dotnet build src/Backend/AutopilotMonitor.Functions/AutopilotMonitor.Functions.csproj --configuration Release --no-restore + + - name: Publish + run: dotnet publish src/Backend/AutopilotMonitor.Functions/AutopilotMonitor.Functions.csproj --configuration Release --output ./publish --no-build + + - name: Deploy to Azure Functions + uses: Azure/functions-action@v1 + with: + app-name: autopilotmonitor-api + package: ./publish + publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}