Skip to content

Commit 85d6444

Browse files
committed
deployment yml serviceDependencies TradingWebApp.csproj.server
1 parent 7904dbd commit 85d6444

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

.github/workflows/TradingWebASP.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and deploy .NET Core application to Web App TradingWebASP
2+
on:
3+
push:
4+
branches:
5+
- master
6+
env:
7+
AZURE_WEBAPP_NAME: TradingWebASP
8+
AZURE_WEBAPP_PACKAGE_PATH: TradingWebApp.Server/publish
9+
CONFIGURATION: Release
10+
DOTNET_CORE_VERSION: 8.0.x
11+
WORKING_DIRECTORY: TradingWebApp.Server
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Setup .NET SDK
18+
uses: actions/setup-dotnet@v3
19+
with:
20+
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
21+
- name: Restore
22+
run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
23+
- name: Build
24+
run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
25+
- name: Test
26+
run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build
27+
- name: Publish
28+
run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
29+
- name: Publish Artifacts
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: webapp
33+
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
34+
deploy:
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- name: Download artifact from build job
39+
uses: actions/download-artifact@v3
40+
with:
41+
name: webapp
42+
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
43+
- name: Deploy to Azure WebApp
44+
uses: azure/webapps-deploy@v2
45+
with:
46+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
47+
publish-profile: ${{ secrets.TradingWebASP_2B67 }}
48+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

TradingWebApp.Server/Properties/serviceDependencies.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"dependencies": {
33
"apis1": {
44
"type": "apis"
5+
},
6+
"mssql1": {
7+
"type": "mssql",
8+
"connectionId": "ConnectionStrings:TradingDatabase",
9+
"dynamicId": null
510
}
611
}
712
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<NameOfLastUsedPublishProfile>C:\Users\Admin\source\repos\TradingWebApp\TradingWebApp.Server\Properties\PublishProfiles\TradingWebASp - Web Deploy.pubxml</NameOfLastUsedPublishProfile>
4+
<NameOfLastUsedPublishProfile>C:\Users\Admin\Source\Repos\ASPReactTypeScript\.github\workflows\TradingWebASP.yml</NameOfLastUsedPublishProfile>
55
</PropertyGroup>
66
</Project>

0 commit comments

Comments
 (0)