-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (37 loc) · 1.43 KB
/
azure_deployment.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
name: Azure Deployment
on:
push:
branches:
- main
env:
AZURE_WEBAPP_PACKAGE_PATH: '' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '5.0.302' # this is set to the GA version of .NET 5
jobs:
build:
runs-on: windows-latest
steps:
# Checkout the repo
- uses: actions/checkout@master
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and publish
- name: dotnet build and publish
run: |
dotnet restore src/DevHours.CloudNative.Api/DevHours.CloudNative.Api.csproj
dotnet build --configuration Release src/DevHours.CloudNative.Api/DevHours.CloudNative.Api.csproj
dotnet publish --configuration Release src/DevHours.CloudNative.Api/DevHours.CloudNative.Api.csproj -o ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/app
# Deploy to Azure Web apps
- name: 'Run Azure webapp deploy action using azure credentials'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/app'
- name: logout
run: |
az logout