-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (101 loc) · 3.42 KB
/
azure-deploy.yml
File metadata and controls
116 lines (101 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Deploy to Azure App Service
on:
push:
branches:
- main
workflow_dispatch:
inputs:
# .NET 8 disabled - uncomment to re-enable:
# deploy_net8:
# description: 'Deploy .NET 8 version'
# type: boolean
# default: true
deploy_net10:
description: 'Deploy .NET 10 version'
type: boolean
default: true
env:
# App Service names - update these to match your Azure resources
# .NET 8 disabled - uncomment to re-enable:
# AZURE_WEBAPP_NET8: perfsimdotnet8
AZURE_WEBAPP_NET10: PerfSimDotNet
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# .NET 8 disabled - uncomment to re-enable:
# - framework: net8.0
# dotnet-version: '8.0.x'
# artifact-name: publish-net8
- framework: net10.0
dotnet-version: '10.0.x'
artifact-name: publish-net10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore src/PerfProblemSimulator/PerfProblemSimulator.csproj
- name: Build (${{ matrix.framework }})
run: dotnet build src/PerfProblemSimulator/PerfProblemSimulator.csproj --configuration Release --framework ${{ matrix.framework }} --no-restore
- name: Publish (${{ matrix.framework }})
run: dotnet publish src/PerfProblemSimulator/PerfProblemSimulator.csproj --configuration Release --framework ${{ matrix.framework }} --no-build --output ./publish
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ./publish
# .NET 8 deployment disabled - uncomment to re-enable:
# deploy-net8:
# needs: build
# runs-on: ubuntu-latest
# if: github.event_name == 'push' || github.event.inputs.deploy_net8 == 'true'
#
# steps:
# - name: Download .NET 8 artifact
# uses: actions/download-artifact@v4
# with:
# name: publish-net8
# path: ./publish-net8
#
# - name: Login to Azure
# uses: azure/login@v2
# with:
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
# subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
#
# - name: Deploy to Azure Web App (.NET 8)
# uses: azure/webapps-deploy@v3
# with:
# app-name: ${{ env.AZURE_WEBAPP_NET8 }}
# package: ./publish-net8
deploy-net10:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.inputs.deploy_net10 == 'true'
steps:
- name: Download .NET 10 artifact
uses: actions/download-artifact@v4
with:
name: publish-net10
path: ./publish-net10
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy to Azure Web App (.NET 10)
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NET10 }}
package: ./publish-net10