-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (41 loc) · 1.21 KB
/
deploy.yml
File metadata and controls
49 lines (41 loc) · 1.21 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
name: Deploy Web App
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build app
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o publish
working-directory: Assignment1/Assignment1_WebApp
- name: Login to Azure (OIDC)
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Zip publish output
run: |
cd Assignment1/Assignment1_WebApp/publish
zip -r ${{ github.workspace }}/publish.zip .
- name: Deploy via Azure CLI
run: |
az webapp deploy \
--resource-group cscd396assignment1 \
--name cscd396assignment1webapp \
--src-path ${{ github.workspace }}/publish.zip \
--type zip