-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.61 KB
/
Copy pathdeploy.yml
File metadata and controls
59 lines (50 loc) · 1.61 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
name: Build and deploy ASP.Net Core app to an Azure Web App
env:
AZURE_WEBAPP_NAME: stream-finder-api
AZURE_WEBAPP_PACKAGE_PATH: 'backend/publish' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '10' # set this to the .NET Core version to use
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
permissions:
contents: none
runs-on: ubuntu-latest
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: build frontend
run: |
npm ci
npm run build --if-present
working-directory: frontend
- name: copy frontend to wwwroot
run: |
mkdir backend/wwwroot
cp -r frontend/dist/* backend/wwwroot/
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: build and publish backend
run: dotnet publish --configuration Release --output publish
working-directory: backend
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}