84 lines (68 loc) · 2.76 KB
/
devdeploy.yml
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
# This workflow will build and push a .NET Core application to an Azure Web App on every push to the main branch.
#
# To configure this workflow:
# 1. Set up secrets
# AZURE_CUSTOMER_WEBAPP_NAME - set to the name of the publisher APP
# AZURE_CUSTOMER_WEBAPP_PUBLISH_PROFILE - upload contents of Azure Customer App publish profile.
# AZURE_PUBLISHER_WEBAPP_NAME - set to the name of the publisher APP
# AZURE_PUBLISHER_WEBAPP_PUBLISH_PROFILE - upload contents of Azure Publisher App publish profile.
name: "Deploy WEB Apps to dev"
on:
push:
branches:
- main
env:
CUSTOMER_PROJECT: './src/CustomerSite/CustomerSite.csproj'
CUSTOMER_AZURE_WEBAPP_PACKAGE_PATH: './src/Marketplace.SaaS.Accelerator.CustomerSite/publish'
PUBLISHER_PROJECT: './src/AdminSite/AdminSite.csproj'
PUBLISHER_AZURE_WEBAPP_PACKAGE_PATH: './src/Marketplace.SaaS.Accelerator.AdminSite/publish'
DOTNET_CORE_VERSION: '6.0.x'
jobs:
deploytocustomer:
name: Deploy customer app to dev
runs-on: ubuntu-latest
environment: dev
steps:
# Checkout the repo
- uses: actions/checkout@main
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
# Run dotnet build and publish
- name: Build app
run: |
dotnet build ${{ env.CUSTOMER_PROJECT }} --configuration Release
dotnet publish ${{ env.CUSTOMER_PROJECT }} --configuration Release --no-build --output ${{ env.CUSTOMER_AZURE_WEBAPP_PACKAGE_PATH }}
# Deploy to Azure Web app
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_CUSTOMER_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_CUSTOMER_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.CUSTOMER_AZURE_WEBAPP_PACKAGE_PATH }}
deploytopublisher:
name: Deploy publisher app to dev
runs-on: ubuntu-latest
environment: dev
steps:
# Checkout the repo
- uses: actions/checkout@main
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
# Run dotnet build and publish
- name: Build app
run: |
dotnet build ${{ env.PUBLISHER_PROJECT }} --configuration Release
dotnet publish ${{ env.PUBLISHER_PROJECT }} --configuration Release --no-build --output ${{ env.PUBLISHER_AZURE_WEBAPP_PACKAGE_PATH }}
# Deploy to Azure Web app
- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_PUBLISHER_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_PUBLISHER_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.PUBLISHER_AZURE_WEBAPP_PACKAGE_PATH }}