File tree Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 27
27
- name : dotnet publish
28
28
run : dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
29
29
30
+ - name : Install dotnet ef
31
+ run : dotnet tool install -g dotnet-ef --version 8.*
32
+
33
+ - name : Create migrations bundle
34
+ run : dotnet ef migrations bundle --runtime linux-x64 -o ${{env.DOTNET_ROOT}}/myapp/migrationsbundle
35
+
30
36
- name : Upload artifact for deployment job
31
37
uses : actions/upload-artifact@v4
32
38
with :
@@ -39,21 +45,21 @@ jobs:
39
45
environment :
40
46
name : ' Production'
41
47
url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
42
- permissions :
43
- id-token : write # This is required for requesting the JWT
48
+ permissions :
49
+ id-token : write # This is required for requesting the JWT
44
50
45
51
steps :
46
52
- name : Download artifact from build job
47
53
uses : actions/download-artifact@v4
48
54
with :
49
55
name : .net-app
50
-
51
- - name : Login to Azure
52
- uses : azure/login@v2
53
- with :
54
- client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_35BD3300570A468CAD1821F29FB6EA6F }}
55
- tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_AA47BBAF1358488B9F8FBF2D13596B4F }}
56
- subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_047C3DAF5D6A43F5820F945416A215E8 }}
56
+
57
+ - name : Login to Azure
58
+ uses : azure/login@v2
59
+ with :
60
+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_35BD3300570A468CAD1821F29FB6EA6F }}
61
+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_AA47BBAF1358488B9F8FBF2D13596B4F }}
62
+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_047C3DAF5D6A43F5820F945416A215E8 }}
57
63
58
64
- name : Deploy to Azure Web App
59
65
id : deploy-to-webapp
Original file line number Diff line number Diff line change 9
9
options . UseSqlServer ( builder . Configuration . GetConnectionString ( "MyDbConnection" ) ) ) ;
10
10
builder . Services . AddDistributedMemoryCache ( ) ;
11
11
}
12
- // else
13
- // {
14
- // builder.Services.AddDbContext<MyDatabaseContext>(options =>
15
- // options.UseSqlServer(builder.Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING")));
16
- // builder.Services.AddStackExchangeRedisCache(options =>
17
- // {
18
- // options.Configuration = builder.Configuration["AZURE_REDIS_CONNECTIONSTRING"];
19
- // options.InstanceName = "SampleInstance";
20
- // });
21
- // }
12
+ else
13
+ {
14
+ builder . Services . AddDbContext < MyDatabaseContext > ( options =>
15
+ options . UseSqlServer ( builder . Configuration . GetConnectionString ( "AZURE_SQL_CONNECTIONSTRING" ) ) ) ;
16
+ builder . Services . AddStackExchangeRedisCache ( options =>
17
+ {
18
+ options . Configuration = builder . Configuration [ "AZURE_REDIS_CONNECTIONSTRING" ] ;
19
+ options . InstanceName = "SampleInstance" ;
20
+ } ) ;
21
+ }
22
22
23
23
// Add services to the container.
24
24
builder . Services . AddControllersWithViews ( ) ;
You can’t perform that action at this time.
0 commit comments