-
-
Notifications
You must be signed in to change notification settings - Fork 121
41 lines (34 loc) · 1.18 KB
/
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
name: Deploy to Azure Web App
on:
push:
branches:
- master
env:
AZURE_WEBAPP_NAME: fuget
AZURE_WEBAPP_PACKAGE_PATH: '.'
DOTNET_VERSION: '5.0.x'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: dev
steps:
# Checkout the repo
- uses: actions/[email protected]
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and publish
- name: Build and publish
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/${{ env.AZURE_WEBAPP_NAME }}'
# Deploy to Azure Web apps
- name: 'Run Azure webapp deploy'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/${{ env.AZURE_WEBAPP_NAME }}'