Skip to content

Commit e155476

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 39c7f43 commit e155476

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/main_dmfunc.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy dotnet core app to Azure Function App - DMFunc
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: windows-latest
19+
permissions:
20+
id-token: write #This is required for requesting the JWT
21+
22+
steps:
23+
- name: 'Checkout GitHub Action'
24+
uses: actions/checkout@v4
25+
26+
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
27+
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: ${{ env.DOTNET_VERSION }}
30+
31+
- name: 'Resolve Project Dependencies Using Dotnet'
32+
shell: pwsh
33+
run: |
34+
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
35+
dotnet build --configuration Release --output ./output
36+
popd
37+
38+
- name: Login to Azure
39+
uses: azure/login@v1
40+
with:
41+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_62CD0D9CA8F2441D861B78A353CB88B3 }}
42+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7DF8E53EFBDD460694E23AB9108B89E4 }}
43+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_8BDE497A163042C9A21A52166CEF92CC }}
44+
45+
- name: 'Run Azure Functions Action'
46+
uses: Azure/functions-action@v1
47+
id: fa
48+
with:
49+
app-name: 'DMFunc'
50+
slot-name: 'Production'
51+
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
52+

0 commit comments

Comments
 (0)