Skip to content

Update main_chat-console.yml #7

Update main_chat-console.yml

Update main_chat-console.yml #7

name: Build and deploy ASP.Net Core app to Azure Web App - chat-console
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Build with dotnet
run: dotnet build WebGame/NotionWebApp.sln --configuration Release
- name: dotnet publish
run: dotnet publish WebGame/NotionWebApp.sln -c Release -o ${{env.DOTNET_ROOT}}/myapp
# Debug step: Verify files before uploading
- name: List files in publish folder
run: dir ./myapp
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: .net-app
path: ./myapp # Ensure this path matches the publish folder
deploy:
runs-on: windows-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: .net-app
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'chat-console'
slot-name: 'production'
package: ./myapp # Ensure correct path for deployment package
publish-profile: ${{ secrets.AzureAppService_PublishProfile_1234 }}