-
Notifications
You must be signed in to change notification settings - Fork 293
68 lines (57 loc) · 2.25 KB
/
saas-app-deploy.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
---
name: ASDK Saas Sample App - Deploy to Azure Web Services
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
AZURE_WEBAPP_NAME: 'saas-app-asdk-test-v23y' # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: . # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: 8.x.x
PROJECT_DIR: ./src/Saas.Application/Saas.Application.Web
PROJECT_PATH: ./src/Saas.Application/Saas.Application.Web/Saas.Application.Web.csproj
OUTPUT_PATH: ./publish/saas-app
BUILD_CONFIGURATION: Release # setting the configuration manager build configuration value for our workflow.
APP_NAME: saas-app
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
#azure login
- uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# checkout the repo specifying the branch name in 'ref:'
- uses: actions/checkout@v3
with:
ref: main #IMPORTANT we're checking out and deploying the 'main' branch here
token: ${{ secrets.GITHUB_TOKEN }}
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and publish
- name: dotnet build and publish
run: |
dotnet restore ${{ env.PROJECT_PATH }}
dotnet build ${{ env.PROJECT_PATH }} \
--configuration ${{ env.BUILD_CONFIGURATION }}
dotnet publish ${{ env.PROJECT_PATH }} \
--configuration ${{ env.BUILD_CONFIGURATION }} \
--output '${{ env.OUTPUT_PATH }}/{{ env.AZURE_WEBAPP_NAME }}'
# Deploy to Azure Web apps
- name: Run Azure webapp deploy action using publish profile credentials
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
package: ${{ env.OUTPUT_PATH }}/{{ env.AZURE_WEBAPP_NAME }}
clean: true
restart: true # slot-name: 'PermissionsApi-Staging'
# Azure logout
- name: logout
run: |
az logout